I've scoured the group looking for a solution to this, can't make it
work with containable or with recursive = 2.  I'm using latest
(nightly) 1.2

Model1 hasMany Model 2
Model2 belongsTo Model 1
Model2 hasMany Model 3
Model3 belongsTo Model2

So, I was really hoping to do a $this->Model3->find('all') and get the
data in a single sql query like

select Model3.xxxx, Model2.xxxx,Model1.xxx from Model3 left join Model
2 left join Model1, I think you get the idea, so then I can sort and
filter using fields from any three models.

The best I can do is get Model 3 to join in the Model 2 table, then it
goes through the recursion to get Model 1 data.  Note that I also
tried

this->Model1->Model2->Model3->find('all');

I tried this->Model3->contain(array('Model2'=>'Model1'));
I tried this->Model3->recursive = 2;

Is the only solution custom SQL in query() command?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" 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?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to