Hi,
I am stuck on something that is very simple in concept but I just can't
get it to work right.

I have a HABTM relationship where I want an action to simply add or
remove links between items. Not delete the "real" records themselves
but in SQL terms: just add/remove a line in the linking table. (Like
users and premissions, authors and articles or as in this case users
and projects)

I really don't want to surrender and just insert some homegrown SQL to
find the row and delete it or add it if that is the case.

Problem is I can't find any suitable Model method for this and I
haven't figured out exactly how to do it with Model->save() or set().
Since the action is pretty much "/user/add_project/1" (or the reverse)
so there is no form with lots of data in it for a "normal" save. I have
started trying to load up all the model instances and reworking them
into an array that looks like the ones used in when saving but it will
result in a lot of for loops and array trickery... that is probably why
I am stuck.

So my question (finaly!...) is if there is any really efficient way to
do this kind of action? What would be a "best practice" for adding and
dropping single associations?


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

Reply via email to