protected function pruneScope() { if ($this->node->exists) { return $this->node->descendants(); } return $this->node->newNestedSetQuery(); }
/** * Computes the boundary. * * @return int */ 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; }