Saturday, May 29, 2010

Re: Recursive some only some associations?

Take a look at the Containable behaviour in the CakePHP manual at:
http://book.cakephp.org/view/1323/Containable

The Containable behaviour allows you to specify which related models
are to be included in the find you are making, thus speeding up the
find.
Enjoy,
John

On May 29, 3:07 pm, Antony <antonyc...@gmail.com> wrote:
> Hi all,
>
> I have my models setup so:   Person   ----  Item  ---- Images
>
> I want to be able to display a list of People and their images. I can
> do this through using recursive = 2 but it slows down the page a lot
> as there are many other associations which are not required.
>
> I've tried playing around with bindModel/unbindModel but without any
> luck. I've also tried:
>  $this->Person->recursive = 1;
>  $this->Person->Item->recursive = 1;
> Which I thought might work, but doesn't.
>
> I would really appreciate any help or advice on this!
>
> Cheers,
> Antony

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 cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

No comments: