Hi!

$AIds = $this->A->B->find('list', array('fields' => array('B.a_id'),
'group' => array('B.a_id')));

1.Try One:
                     $this->A->Behaviors->attach('Containable');
                     $this->A->B->Behaviors->attach('Containable');
                     $AsBsAndCs = $this->A->find('all', array
('contain' => array('B' => array('contain' => 'C', 'fields' => array
('C.id', 'C.b_id'))), 'fields' => array('B.id', 'B.a_id')));

      If above dosen't work, try next.

2.Try Two:
                    $As = $this->A->find('all', array('conditions' =>
array('A.id' => $AIds), 'order' => array('A.id' => 'ASC')));

                    $this->A->B->Behaviors->attach('Containable');
                    $this->A->B->find('all', array('contain' => array
('C' => array('fields' => array('C.id', 'C.b_id'))), 'conditions' =>
array('B.a_id' => $AIds), 'order' => array('B.a_id' => 'ASC'),
'fields' => array('B.id', 'B.a_id')));

     This second will definitely work for you.


Best of Luck!

Take Care!
--~--~---------~--~----~------------~-------~--~----~
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