Hi guys,

I'm trying to store multiple MPTTs in a single table using these model
associations:

Menu hasMany MenuItem
MenuItem belongsTo Menu

<?php
class MenuItem extends MenusAppModel {
        var $name = 'MenuItem';
        var $order = array('MenuItem.lft' => 'ASC');
        var $actsAs = array('Tree' => array('scope' => 'Menu'));

        var $belongsTo = array(
                'Menu' => array(
                        'className' => 'Menus.Menu',
                        'foreignKey' => 'menu_id',
                        'conditions' => '',
                        'fields' => '',
                        'order' => '',
                        'counterCache' => '')
        );
}
?>

Above attaches the TreeBehavior using this scope: MenuItem.menu_id =
Menu.id

The problem is that the whole table is treated as one big tree, making
TreeBehavior::up()/down() etc. behave rather funky (obviously).

Anyone have an idea how to make this work?
--~--~---------~--~----~------------~-------~--~----~
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