I am having tough time trying to join two table which are not connected 
directly. For example:

User hasOne Profile
User hasMany Post

I want to join Post and Profile (based on user_id which is common) and tried 
doing couple of things but none worked. 

* Firstly, I tried $hasOne in Post model with ( 'foriegnKey' => false, 
'condition' => 'Post.user_id = Profile.user_id' ). That didn't worked.
* Secondly, I tried using putting 'joins' in $conditions for 
$this->Post->find(...). That didn't worked either.

Last option would be use raw_query, but I am trying to avoid using that.

Any suggestions?

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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