Phalcon\Mvc\Model\Behavior\NestedSet::prependTo PHP Method

prependTo() public method

Prepends node to target as first child.
public prependTo ( Phalcon\Mvc\ModelInterface $target, array $attributes = null ) : boolean
$target Phalcon\Mvc\ModelInterface the target
$attributes array List of attributes.
return boolean
    public function prependTo(ModelInterface $target, array $attributes = null)
    {
        // Re-search $target
        $target = $target::findFirst($target->{$this->primaryKey});
        return $this->addNode($target, $target->{$this->leftAttribute} + 1, 1, $attributes);
    }