Thanks, Works fine! Thought to complicated... :-)
Containable behavior is really nice ;-)

greets
Andreas

Martin Westin schrieb:
> You just go:
>
> 'contain' => array(
>   'Product' => array(
>     'conditions' => array('Product.id' => $productId),
>     'Module' => array(
>       'Subject'
>     )
>   ),
>   'Check'
> )
>
> That is: in contain you simply name the nearest "associates" and in
> each of those you name furhter associates to return.
>
>
>
> On Jun 12, 2:02 pm, Andreas Derksen <andreasderk...@arcor.de> wrote:
>   
>> Hi, im currently developing a checklist application witch has the following 
>> Models and relations:
>> Checklist belongsTo Product
>> Checklist hasMany Check
>> Product HABTM Module
>> Module hasMany Subjects
>> Subject belongsTo Module
>> So, what i want to do now is to generate tables like this:Checklist ID 
>> 2Module 1Subject 1Subject 2Subject 3Subject 4Module 2Subject 1Subject 
>> 2Subject 3Subject 4
>> I tried to query it like this:
>> $this->Checklist->find('first', array('contain' => array(
>>                                                              'Product' => 
>> array('conditions' => array('Product.id' => $productId)),
>>                                                              'Check' )));
>> the result is:Array ( [Checklist] => Array ( [id] => 1 [product_id] => 1 ) 
>> [Product] => Array ( [id] => 1 [name] => Product1 ) [Check] => Array ( [0] 
>> => Array ( [id] => 1 [check] => true [checklist_id] => 1 [subject_id] => 1 ) 
>> ) )Now I need the Product array recursive, means: the associated Module(s) 
>> and the Subject(s) associated to the Module(s).
>> A $this->Checklist->find('first', array('recursive' => 2, 'conditions' => 
>> array('id' => $checklistId))); returns everything I need, ... and more. 
>> thats the problem.
>> How can I do that?
>> Thanks in advance
>> Andreas
>>     
> >
>   

--~--~---------~--~----~------------~-------~--~----~
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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to