First, sorry if subject name isn't accurate; I don't know how exactly
to phrase what I'm searching for...

Here's the issue- I have a table which generates a menu for me.  The
table has primary_key, name, parent_id, display, order_in_list.  Below
is a sample table with display and order_in_list removed.
primary  key
|    name
|    |        parent_id
|    |                     |
|    |                     |
1   MenuItemA   0
2   MenuItemB   0
3   SubItemA      1
4   SubItemB      1
5   SubMenuA    2
6   SubItemC     5
7   SubItemD     5

Here's roughly what the menu should look like:

-MenuItemA
    -SubItemA
    -SubItemB
-MenuItemB
    -SubMenuA
        -SubItemC
        -SubItemD

This is what my model currently is:

var $hasMany = array
(
        'ChildNavMenu'=>array
        (
                'className'=>'Navmenu',
                'foreignKey'=>'parent_id',
                'conditions'=>array
                (
                        'display'=>'1'
                ),
                'order'=>'order_in_list'
        )
);

This correctly creates children of parents, BUT fails to create
children of children of parents (SubItemC + SubItemD in example
above.)  Does anybody know of a way to change the $hasMany in order to
include this critical data?

Thanks,
Dima

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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