Hi there,

I'm having trouble to understand the way saveAll works.
I have to models. One for storing addresses and the other one to
protocol changes on the addresses.

class Adresse extends AppModel {
    var $name = 'Adresse';

        var $hasMany = 'Adressenchangelog';
-- snip --

class Adressenchangelog extends AppModel {
    var $name = 'Adressenchangelog';

        var $belongsTo = 'Adresse';
}


The changelog should be created within beforeSave(). After testing
different kinds of how to write this to be saved, I'm stuck now.

This is the manual Test - and dowsn't work (undefined index-warning in
model.php):
$this->data['Adressenchangelog'] = array('adresse_id' => $this-
>data['Adresse']['id'], 'user_realname' => 'jaja');
$this->Adresse->saveAll($this->data, array('validate'=>'first'));

If I try this, it still doesn't work:
$this->data['Adresse']['Adressenchangelog'] = array('adresse_id' =>
$this->data['Adresse']['id'], 'user_realname' => 'jaja');

If I split the save-Commands like that, it works:
$this->Adresse->save( $this->data );
$this->Adresse->Adressenchangelog->save( $this->Adresse-
>Adressenchangelog->data );


So how do I need to set this up?

thanks in advance
Klaus

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to