Phalcon\Mvc\Model\Behavior\NestedSet::prependTo PHP 메소드

prependTo() 공개 메소드

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.
리턴 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);
    }