Group hasMany GroupPost

User hasAndBelongsToMany Group

and i wanna  find all groupPosts from groups belongs to user

or maybe i can explain it this way :   aUser->groups->group_posts


On Sat, May 15, 2010 at 2:47 PM, still <[email protected]> wrote:

> Im having some difficulty on using find method in some complexed model
> relationships( its not so complexed in fact.).
> there are three models in my project : User Group and GroupPost
>
> User HABTM Group through a join table group_memberships ( i made a
> model for this table name GroupMembership).
>
> then im having a question about how can i find all GroupPosts those
> all from the Groups a User joined (have a membership in other word).
> I know i can find it by a sql query. but its a little bit ugly. can i
> doing this by a pretty model relationship based find method?
>
> can anyone help me ? thanks a lot !

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