> I try to insert a new association between Users ans Applications.
>
> That's the code:
>
> $data=array('User'=>array('id'=>$userId),
>                                         
> 'Application'=>array('Application'=>array('id'=>$applicationId)),
>                                                                               
>   'id'=>null);
>
> $this->User->save($data);
>
> But this delete all previous association and then insert this one.

$data = array();
$data['User']['id] = $userId;
$data['Application']['Application'] = array('ids', 'of', 'existing',
'and', 'new', 'items');

$this->User->save($data);

or check out http://bakery.cakephp.org/articles/view/202

more info also in the manual

jon

>
> So how to insert a new association without deleting others one ?
>
>
> >
>


-- 


jon bennett
t: +44 (0) 1225 341 039 w: http://www.jben.net/
iChat (AIM): jbendotnet Skype: jon-bennett

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to