A user can select multiple profiles via a screen. I get these values
in my controller. I want to "link" all these profiles with the user.
Currently i'm doing:
$profile_1['Profile']['id'] = 1234; //the profile id
$profile_1['User']['id'] = 1010; // The user id
$this->User->save($profile_1);
$profile_2['Profile']['id'] = 5678; //the profile id
$profile_2['User']['id'] = 1010; // The user id same as before
$this->User->save($profile_2);
However, this creates only the 2nd link in the HABTM table.
Is there a way that I can create both the links (1010-1234 and
1010-5678) in a single shot?
Thanks!
Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
No comments:
Post a Comment