Gets the previous sibling of the node.
@return \yii\db\ActiveQuery
503092
public function prev() {
        $condition = [$this->rightAttribute => $this->owner->getAttribute($this->leftAttribute) - 1];
        $this->applyTreeAttributeCondition($condition);

        return $this->owner->find()->andWhere($condition);
    }
248964
public function getFirst()
    {
        $element = null;

        if (
            $this->hasParent() and
            $this->parent->hasElements()
        ) {
            $element = $this->parent->elements[0];
        }

        return $element;
    }
1019509
def get_prev_sibling(self):
        
        try:
            return self.get_siblings().filter(path__lt=self.path).reverse()[0]
        except IndexError:
            return None
995903
public function siblingMenu()
    {
        $nb = $this->spawn('siblingMenu', new Collection());

        $parent = $this->active()->parent();
        if ($parent) {
            $siblings = $parent->children();
        } else {
            $siblings = $this->roots();
        }

        if ($siblings->count() > 1) {
            foreach ($siblings as $s) {
                $nb->add($s->title, $s->url());
            }
        }

        return $nb;
    }
200353
public function getPrevious()
    {
        return is_null($this->previous) ? null : new ViewFile($this->project, $this->previous);
    }
6279
public function current()
    {
        $document = $this->getCursor()->current();

        if ($document instanceof ActiveRecord) {
            $documentToArray = $document->toArray();
            $this->entitySchema = $document->getSchema();
        } else {
            $documentToArray = (array) $document;
        }

        return $this->getAssembler()->assemble(
            $documentToArray,
            $this->entitySchema
        );
    }
146736
public function previousChild($id)
    {
        $child = $this->getchild($id);
        $next  = $this->children[$child->id()]['prev'];

        return $this->getChild($next);
    }
639226
protected function getPrevious() {
		if ($this->get('page')> 1) {
			return $this->replaceLine($this->get('page') - 1, $this->get('previous'));
		}
		return null;
	}
1174900
public function getFirstChild()
	{
		$xpathStr = self::XPATH_THIS . '*[1]';
		$results = $this->xpath($xpathStr);
		if (count($results) >= 1) {
			return $results[0];
		}
		return null;
	}
1111369
public function getCurrentRow()
    {
        if (isset($this->_currentRow) && $this->_currentRow->isFilled()) {
            $this->_currentRow = null;
        }
        if (is_null($this->_currentRow)) {
            $this->_currentRow = Yii::createObject(array_merge(['class' => $this->rowClass], $this->baseRow));
            $this->_rows[] = $this->_currentRow;
        }

        return $this->_currentRow;
    }
90493
public static function get_previous_textnode( \DOMNode $node = null ) {
		return self::get_adjacent_textnode(
			function( &$another_node = null ) {
				$another_node = $another_node->previousSibling;
				return self::get_last_textnode( $another_node );
			},
			[ __CLASS__, __FUNCTION__ ],
			$node
		);
	}
1058797
public function getNode()
    {
        if(null === $this->node)
        {
            $request = $this->requestStack->getCurrentRequest();
            $this->node = $this->readNode(RequestFilter::getFinder($request, $this->contentPath));
        }

        return $this->node;
    }
479589
public function getRoot()
    {
        if ( $this->owner->{$this->parentIdField} ) {
            return Yii::$app->db->cache(function(){
                return call_user_func("$this->ownerClassName::findOne", current($this->getParentsId()));
            }, null, $this->getTagDependency());
        } else {
            return $this->owner;
        }
    }
78480
public function siblings()
    {
        if ($p = $this->parent) {
            return $p->children->filter(function ($item) {
                return $item->id !== $this->id;
            });
        }

        return null;
    }
927262
public function getRelated()
	{
		if($this->parent->getRawColumnValue($this->getForeignKey()) === null)
		{
			return false;
		}

		return $this->first();
	}
1182227
public function getDepth(){

        if($this->depth === NULL){

            if($this->isRootNode()){
                $this->depth = -1;
            }
            else{
                $parents = [$this];
                $node = $this;
                while($parent = $node->parentNode()){
                    if(!$parent->isRootNode()){
                        $parents[] = $parent;
                    }
                    $node = $parent;
                }
                $this->depth = count($parents);
            }
        }

        return $this->depth;
    }
1356576
public function getCurrentRoot()
    {
        if (null !== $this->getCurrentPage()) {
            return $this->getCurrentPage()->getRoot();
        } elseif (null === $this->getCurrentSite()) {
            return;
        } else {
            return $this->application->getEntityManager()
                ->getRepository('BackBee\NestedNode\Page')
                ->getRoot($this->getCurrentSite())
            ;
        }
    }