Neos\ContentRepository\Domain\Model\Node::getParent PHP Method

getParent() public method

Returns the parent node of this node
public getParent ( ) : Neos\ContentRepository\Domain\Model\NodeInterface
return Neos\ContentRepository\Domain\Model\NodeInterface The parent node or NULL if this is the root node
    public function getParent()
    {
        if ($this->getPath() === '/') {
            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;
    }
Node