Reputation: 4103
i'm using Doctrine 2 and the NestedSet extension.
In Doctrine 1 you had the functions moveAsPrevSiblingOf
, moveAsNextSiblingOf
and moveAsLastChildOf
To move nodes around.
In the documentation of the nested extension only moving a node within the same parent is explained. Move a node to another node is not mention. How can this be done?
Are there easy to use functions as found in Doctrine 1 available?
Upvotes: 2
Views: 1560
Reputation: 4103
In the documentation there are examples on how to move the nodes.
$treeRepository
->persistAsFirstChild($food)
->persistAsFirstChildOf($fruits, $food)
->persistAsLastChildOf($vegitables, $food)
->persistAsNextSiblingOf($carrots, $fruits);
Upvotes: 1