Returns the parent node of this node

@return \BeeTree\Contracts\Node
166138
public function getParent()
    {
        if ($this->isRoot()) {
            return;
        }

        if (isset($this->relations['parent'])) {
            return $this->relations['parent'];
        }
        return $this->getAttribute('parent');
    }
0
protected function parentId()
	{
		switch ( $this->position )
		{
			case 'root':
				return null;

			case 'child':
				return $this->target->getKey();

			default:
				return $this->target->getParentId();
		}
	}
563549
public function getNode()
    {
        foreach ($this->nodeProviders as $provider) {
            if ($node = $provider->getNode()) {
                return $node;
            }
        }

        return null;
    }
1362717
protected function get_parent_record() {
        global $DB;

        if (!isset($this->parentrecord)) {
            $this->parentrecord = $DB->get_record('event', ['id' => $this->parentid]);
        }

        return $this->parentrecord;
    }
630772
public function getParent() {

		$pageClass = Yii::$app->cms->getPageClass( $this->type );

		return $this->hasOne( $pageClass, [ 'id' => 'parentId' ] );
	}
437214
public function getParentRepository()
    {
        if (null == $this->parentRepository) {
            $this->setParentRepository(
                Orm::getRepository($this->getParentEntity())
            );
        }
        return $this->parentRepository;
    }
1259239
public function getParent()
    {
        if (\is_string($this->parent)) {
            $parent = TypeCollection::getInstance()->getTypeByName($this->parent);
            \assert($parent instanceof ObjectType);

            return $parent;
        }

        return $this->parent;
    }
671039
public function getRootNodes()
    {
        $root = [];

        foreach ($this->nodes as $appName => $nodes) {
            foreach ($nodes as $name => $migration) {
                // get the nodes  parent
                $parents = $this->getNodeFamilyTree($appName, $name)->parent;

                // if no parent exist this must be the first migration aka
                // adam/eve which ever tickles your fancy
                if (empty($parents)) {
                    $root[$appName] = $name;
                }
            }
        }

        return $root;
    }
1357894
public function getLevel()
    {
        if ($this->_level !== null) {
            return $this->_level;
        }

        if ($this->isRoot()) {
            $this->_level = -1;
            return $this->_level;
        }

        $parents = array($this);
        $node = $this;

        while ($parent = $node->getParent()){
            if (!$parent->isRoot()) {
                $parents[] = $parent;
            }
            $node = $parent;
        }

        $this->_level = count($parents);

        return $this->_level;
    }
985559
public function parent() {
		$parent = $this->domnode;
		if(!$parent)
			return new Node(null);
		while(true) {
			$parent = $parent->parentNode;
			if(!$parent)
				return;
			if($parent->nodeType == XML_ELEMENT_NODE)
				return new Node($parent);
		}
	}
278817
public function parent($node = null)
	{
		if ($node)
		{
			$parents = $this->xpath('ancestor-or-self::' . $node);
		}
		else
		{
			$parents = $this->xpath('parent::*');
		}

		return $parents[0];
	}
653554
public function getParent()
    {
        if ($this->isRoot()) {
            return null;
        }

        $parentPath = $this->getParentPath();
        $node = $this->context->getFirstLevelNodeCache()->getByPath($parentPath);
        if ($node !== false) {
            return $node;
        }
        $node = $this->nodeDataRepository->findOneByPathInContext($parentPath, $this->context);
        $this->context->getFirstLevelNodeCache()->setByPath($parentPath, $node);

        return $node;
    }
1270056
public function getTree() {
    $children = array();
    $properties = $this->getChildProperties();
    $child = $this->head;
    $i = 0;
    while ($child) {
      $key = array_search($child, $properties, TRUE);
      if (!$key) {
        $key = $i;
      }
      if ($child instanceof ParentNode) {
        $children[$key] = $child->getTree();
      }
      else {
        /** @var TokenNode $child */
        $children[$key] = array($child->getTypeName() => $child->getText());
      }
      $child = $child->next;
      $i++;
    }
    $class_name = get_class($this);
    return array($class_name => $children);
  }
1295277
public function getRoot() {

		$parentTable = CoreTables::getTableName( CoreTables::TABLE_CATEGORY );

		return $this->hasOne( Category::class, [ 'id' => 'rootId' ] )->from( "$parentTable as root" );
	}
1128339
public function parents()
    {
        if (!$this->nodes) {
            throw new \InvalidArgumentException('The current node list is empty.');
        }

        $node = $this->getNode(0);
        $nodes = array();

        while ($node = $node->parentNode) {
            if (XML_ELEMENT_NODE === $node->nodeType) {
                $nodes[] = $node;
            }
        }

        return $this->createSubCrawler($nodes);
    }
754553
public function getParent()
    {
        $parentID = $this->getField("ParentID");
        if ($parentID) {
            return SiteTree::get_by_id(self::class, $parentID);
        }
        return null;
    }
970153
function get_parent(){
		if( !is_null($this->pidx) && isset(self::$reg[$this->pidx]) ){
			return self::$reg[$this->pidx];
		}
		else {
			return null;
		}
	}