Baum\Move::bound1 PHP Method

bound1() protected method

Computes the boundary.
protected bound1 ( ) : integer
return integer
    protected function bound1()
    {
        if (!is_null($this->_bound1)) {
            return $this->_bound1;
        }
        switch ($this->position) {
            case 'child':
                $this->_bound1 = $this->target->getRight();
                break;
            case 'left':
                $this->_bound1 = $this->target->getLeft();
                break;
            case 'right':
                $this->_bound1 = $this->target->getRight() + 1;
                break;
            case 'root':
                $this->_bound1 = $this->node->newNestedSetQuery()->max($this->node->getRightColumnName()) + 1;
                break;
        }
        $this->_bound1 = $this->_bound1 > $this->node->getRight() ? $this->_bound1 - 1 : $this->_bound1;
        return $this->_bound1;
    }