Re: Question Concerning Nested Relationships

2009-10-22 Thread Andrew

Nice! Thanks a lot.

On Oct 22, 3:20 am, Bert Van den Brande  wrote:
> Use the Containable behavior :http://book.cakephp.org/view/474/Containable
>
> On Wed, Oct 21, 2009 at 7:32 PM, Andrew wrote:
>
>
>
>
>
> > I've got a Post model set up that has a BelongsTo relationship to a
> > Group model. This Group is related by HABTM to 1+ Media models.
>
> > The Post model has other BelongsTo and HABTM relationships to other
> > classes.
>
> > What I'd like to do is in the Post model retrieve the Media models
> > related to it through the Group model without retrieving any more of
> > the other relationships in the Post model. In other words, I'd like to
> > set recursive=2 for the Group model and recursive=1 for other
> > relationships. What's the best way to do this? Thanks!
>
> > ~Andrew
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Question Concerning Nested Relationships

2009-10-22 Thread Bert Van den Brande
Use the Containable behavior : http://book.cakephp.org/view/474/Containable

On Wed, Oct 21, 2009 at 7:32 PM, Andrew wrote:

>
> I've got a Post model set up that has a BelongsTo relationship to a
> Group model. This Group is related by HABTM to 1+ Media models.
>
> The Post model has other BelongsTo and HABTM relationships to other
> classes.
>
> What I'd like to do is in the Post model retrieve the Media models
> related to it through the Group model without retrieving any more of
> the other relationships in the Post model. In other words, I'd like to
> set recursive=2 for the Group model and recursive=1 for other
> relationships. What's the best way to do this? Thanks!
>
> ~Andrew
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Question Concerning Nested Relationships

2009-10-21 Thread Andrew

I've got a Post model set up that has a BelongsTo relationship to a
Group model. This Group is related by HABTM to 1+ Media models.

The Post model has other BelongsTo and HABTM relationships to other
classes.

What I'd like to do is in the Post model retrieve the Media models
related to it through the Group model without retrieving any more of
the other relationships in the Post model. In other words, I'd like to
set recursive=2 for the Group model and recursive=1 for other
relationships. What's the best way to do this? Thanks!

~Andrew

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---