views:

169

answers:

1

Hello, although I read through the manual here: http://www.doctrine-project.org/documentation/manual/1_2/hu/hierarchical-data I couldn't find a way to move a node from a Leaf to become a Root node. Any clues? The question is trivial for inserting a new node...but what about updating a node?

A: 

Use Doctrine_Node_NestedSet::makeRoot() like so:

$item->getNode()->makeRoot($maxRootValue + 1);

You need to pass new root_id value and one of the easiest way to do this is to select MAX(root_id) from table and increment its value.

Crozin