Neos\Neos\View\TypoScriptView::getClosestDocumentNode PHP Method

getClosestDocumentNode() protected method

protected getClosestDocumentNode ( Neos\ContentRepository\Domain\Model\NodeInterface $node ) : Neos\ContentRepository\Domain\Model\NodeInterface
$node Neos\ContentRepository\Domain\Model\NodeInterface
return Neos\ContentRepository\Domain\Model\NodeInterface
    protected function getClosestDocumentNode(NodeInterface $node)
    {
        while ($node !== null && !$node->getNodeType()->isOfType('Neos.Neos:Document')) {
            $node = $node->getParent();
        }
        return $node;
    }