On Oct 13, 2006, at 7:12 AM, leo.cacheux wrote:

>
> Hello everyone.
>
> I want to display a table in a CakePHP with informations from 3  
> tables,
> let's call them posts, users, profiles, and the 3 associated models
> Post, User, Profile.
> "Post" has a foreign key to "User", and "User" has a foreign key to
> "Profile", so I could get all the informations I want with two LEFT
> JOIN on those keys, but I can't do it with a findAll call on "Post".
> When I put "recursive" > 1, I can get what I want, but CakePHP make  
> one
> subquery for each line, instead of using another LEFT JOIN, so I can't
> sort the table with something from the "Profile" model.
> I use "belongsTo" association with my models. Am I wrong or did I
> missed something ?
> I know I can write the query myself, but is there a way to let CakePHP
> do it itself ?

Yeah, check out model associations: have you already set them up?

http://manual.cakephp.org/chapter/models (Section 4)

-- John



>
> Thanks in advance.
>
>
> >


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

Reply via email to