So say i'm working on a blog applicaiton and I have the HABTM
association set up between the post model and the tag model.

What I can't figure out is how do I 1.) call a findAll and get all the
posts that have two specific tags; and 2.) how do I get those results
to contain the other tags associated to the returned posts.

Somewhere I want to be able to write something to the effect
'condtions' => 'tag_id =3 and tag_id = 6', or find all posts that have
the tag with id 3 and the tag with id 6.

My understanding is that I can't reference the tag in the findAll
statement - so I can't do:
$this->Post->findAll("Tag.id = 3 and Tag.id = 6")

I tried putting the condition in the association on the fly with
bindModel but ran into two problems - one being it would only accept
one condition and not two conditions, and the other problem is that it
excludes all the other tags in the result, so only the matching tags
get returned.

Any suggestions would be appreciated.


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