I have CakePHP 1.3
multiple tree in the table and for moveup
and movedown
i set
$this->Category->Behaviors->attach('Tree', array(
'scope' => array(
'Category.parent_id' => $node['Category']['parent_id'],
),
));
but also the records are also categorized by type
so I also need
'Category.type' => $node['Category']['type'],
and like this it does not make any difference.
Here is sample of my data:
id | parent_id | lft | rght | Title | type
1 | null | 1 | 4 | Cat1 | categoory
2 | null | 5 | 20 | Cat2 | categoory
3 | 2 | 6 | 13 |Cat2.1 | categoory
4 | 2 | 14 | 15 |Cat2.2 | categoory
5 | 2 | 16 | 17 | img1 | image
6 | 1 | 2 | 3 | img1 | image
7 | 2 | 18 | 19 | img2 | image
8 | 3 | 7 | 8 | Post1 | post
9 | 3 | 9 | 10 | Post2 | post
10 | 3 | 11 | 12 |Cat2.1.1| categoory