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 2

Module 1
Subject 1
Subject 2
Subject 3
Subject 4

Module 2
Subject 1
Subject 2
Subject 3
Subject 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 [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