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

next() public method

Named scope. Gets next sibling of node.
public next ( ) : Phalcon\Mvc\ModelInterface
return Phalcon\Mvc\ModelInterface
    public function next()
    {
        $owner = $this->getOwner();
        $query = $owner::query()->where($this->leftAttribute . '=' . ($owner->{$this->rightAttribute} + 1));
        if ($this->hasManyRoots) {
            $query = $query->andWhere($this->rootAttribute . '=' . $owner->{$this->rootAttribute});
        }
        return $query->execute()->getFirst();
    }