Friday, July 31, 2009

Re: Efficient ways to retrieve data from models with high association depth

On Jul 31, 9:58 am, AD7six <andydawso...@gmail.com> wrote:
> On Jul 31, 12:15 am, Roel <roel....@gmail.com> wrote:
>
> > Ah I like your idea of encapsulating the two finds in a model method.
> > That seems much better than putting the logic in the controller.
> > Thanks.
>
> > Could you please elaborate on the Linkable (and OneQuery) behavior?
> > Anything with regard to optimizing database performance for related
> > models seems relevant to me.
>
> Given that A belongsTo|hasOne B belongsTo|hasOne C belongsTo|hasOne D
> belongsTo|hasOne E etc.
>
> you'll get n queries with cake, and 1 query using Linkable/OneQuery.
> They're used in a similar fashion to containable.
>
> Cheers,
>
> AD

The article by Mark descibes how you can do it by hand
http://mark-story.com/posts/view/using-bindmodel-to-get-to-deep-relations

Cheers,

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