I currently have a habtm association between the models, user and room.
I also have a belongsTo and hasMany between room and comment.
What I would like to do is query the user model so that a specific
room's comments are shown to a specific user. This would require to
state a where for the user_id and the room_id in the join table.
I would like to solve this without creating a model for the join table,
althought that might end up being a current solution.
The current query in the users_controller looks like this:
$this->set('user', $this->User->find(array('User.id' => 1), null, null,
2));
This shows me all the rooms assocaited with user with id as 1. I want
to limit the rooms, and show only, lets say, room with id 2.
Any suggestions on adapting my query to do that? Or is there a better
way to do this?
Any other clean and simple sollutions will be appreciated.
Regards.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---