src/Tree.php
public function move($nodeName, $newParentName, $prepend = false)
    {
        if (!$this->nodes->hasKey($nodeName)) {
            throw new NodeNotFoundException();
        }
        $node = $this->nodes->get($nodeName);
        $this->remove($nodeName);
        $this->add($newParentName, $nodeName, $node, $prepend);

        return $this;
    }
public function move($nodeName, $newParentName, $prepend = false)
    {
        if (!$this->nodes->hasKey($nodeName)) {
            throw new NodeNotFoundException();
        }
        $node = $this->nodes->get($nodeName);
        $this->remove($nodeName);
        $this->add($newParentName, $nodeName, $node, $prepend);

        return $this;
    }
public function move ( $ nodeName , $ newParentName , $ prepend = false ) { if ( ! $ this -> nodes -> hasKey ( $ nodeName ) ) { throw new NodeNotFoundException ( ) ; } $ node = $ this -> nodes -> get ( $ nodeName ) ; $ this -> remove ( $ nodeName ) ; $ this -> add ( $ newParentName , $ nodeName , $ node , $ prepend ) ; return $ this ; }
Moves node to another parent.

@param string $nodeName target node name
@param string|null $newParentName parent node name;  root will be used if null
@param bool $prepend
@return $this
Moves node to another parent .