Did you try to throw a few pr()'s in the controller before the save to
see what the values were set at?
On Mar 30, 9:47 am, "christianandradet" <[EMAIL PROTECTED]>
wrote:
> Iam trying to edit a Cliente an i have this in my model 'Cliente':
> var $name = 'Cliente';
>
> var $hasOne = array('Naturale' => array('className' =>
> 'Naturale',
> 'conditions' => '',
> 'order' => '',
> 'dependent' =>
> true,
> 'foreignKey' =>
> 'CLI_ID'
> )
> );
>
> when i try to save(update) an insert statement is created and an error
> of duplicate entry is shown.
> But i need to edit i do not know why this is happening, i tested it
> with a simplier model and it works fine, please help!!
>
> function edit($id = null)
> {
> if (empty($this->data['Cliente']))
> {
> $this->Cliente->id = $id;
> $this->data = $this->Cliente->read();
> }
> else
> {
> $this->data['Naturale']['CLI_ID'] = $this->data['Cliente']
> ['ID'];
> if($this->Cliente->Naturale->save($this->data['Naturale']))
> if($this->Cliente->save($this->data['Cliente']))
> {
> $this->flash('El cliente fue modificado.','/
> Clientes/');
> }
> }}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" 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
-~----------~----~----~----~------~----~------~--~---