olimortimer/ci-nested-sets

how can i move node to become a tree

Closed this issue · 1 comments

how can i move node to become a tree

First, get the node of the location you'd like to move;
$node = $this->nested_set->getNodeFromId($node_id);

Then get the node of your target location (this could be root);
$target = $this->nested_set->getNodeFromId($target_id);

Then move the node;
$this->nested_set->setNodeAsLastChild($node, $target);