Baum\Move::to PHP Method

to() public static method

Easy static accessor for performing a move operation.
public static to ( Node $node, Node | integer $target, string $position ) : Node
$node Node
$target Node | integer
$position string
return Node
    public static function to($node, $target, $position)
    {
        $instance = new static($node, $target, $position);
        return $instance->perform();
    }

Usage Example

Exemplo n.º 1
0
 /**
  * Main move method. Here we handle all node movements with the corresponding
  * lft/rgt index updates.
  *
  * @param Baum\Node|int $target
  * @param string        $position
  *
  * @return \Baum\Node
  */
 protected function moveTo($target, $position)
 {
     return Move::to($this, $target, $position);
 }