src/Tree.php
public function moveNode($headId, $targetId = null, $mode = self::MODE_UNDER)
    {
        $head = $this->getNode($headId);
        $target = $this->getNode($targetId);

        switch ($mode) {
            case self::MODE_BEFORE:
                $operation = new MoveBefore($head, $target, $this->config, $this);
                break;
            case self::MODE_AFTER:
                $operation = new MoveAfter($head, $target, $this->config, $this);
                break;
            case self::MODE_UNDER:
                $operation = new MoveUnderEnd($head, $target, $this->config, $this);
                break;
        }

        $operation->run();
    }
public function moveNode($headId, $targetId = null, $mode = self::MODE_UNDER)
    {
        $head = $this->getNode($headId);
        $target = $this->getNode($targetId);

        switch ($mode) {
            case self::MODE_BEFORE:
                $operation = new MoveBefore($head, $target, $this->config, $this);
                break;
            case self::MODE_AFTER:
                $operation = new MoveAfter($head, $target, $this->config, $this);
                break;
            case self::MODE_UNDER:
                $operation = new MoveUnderEnd($head, $target, $this->config, $this);
                break;
        }

        $operation->run();
    }
public function moveNode ( $ headId , $ targetId = null , $ mode = self :: MODE_UNDER ) { $ head = $ this -> getNode ( $ headId ) ; $ target = $ this -> getNode ( $ targetId ) ; switch ( $ mode ) { case self :: MODE_BEFORE : $ operation = new MoveBefore ( $ head , $ target , $ this -> config , $ this ) ; break ; case self :: MODE_AFTER : $ operation = new MoveAfter ( $ head , $ target , $ this -> config , $ this ) ; break ; case self :: MODE_UNDER : $ operation = new MoveUnderEnd ( $ head , $ target , $ this -> config , $ this ) ; break ; } $ operation -> run ( ) ; }
Move head node to target node.
@param mixed $headId
@param mixed $targetId
@param int $mode
Move head node to target node .