Tuesday, May 1, 2012

Re: Saving HABTM erases existing records...

On Tuesday, May 1, 2012 5:20:21 PM UTC+7, JonStark wrote:
I tried with 'unique' => false,

It doesn't erase previous ones, but I can follow the same user many times, so it's not that.

And keepExisting seems to wrok exactly the same as 'unique' => true ...

When using 'unique' => 'keepExisting', you still need to pass all the current associations.
This feature is intended for more for not losing extra fields in the join table, eg: users_users.created.

For your use case, it seems that hasMany+belongsTo would be more suitable.

--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.
 
 
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

No comments: