Neos\Neos\Controller\Service\NodesController::adoptNodeAndParents PHP Method

adoptNodeAndParents() protected method

Adopt (translate) the given node and parents that are not yet visible to the given context
protected adoptNodeAndParents ( Neos\ContentRepository\Domain\Model\NodeInterface $node, ContentContext $contentContext, boolean $copyContent ) : void
$node Neos\ContentRepository\Domain\Model\NodeInterface
$contentContext Neos\Neos\Domain\Service\ContentContext
$copyContent boolean TRUE if the content from the nodes that are translated should be copied
return void
    protected function adoptNodeAndParents(NodeInterface $node, ContentContext $contentContext, $copyContent)
    {
        $contentContext->adoptNode($node, $copyContent);
        $parentNode = $node;
        while ($parentNode = $parentNode->getParent()) {
            $visibleInContext = $contentContext->getNodeByIdentifier($parentNode->getIdentifier()) !== null;
            if ($parentNode->getPath() !== '/' && $parentNode->getPath() !== SiteService::SITES_ROOT_PATH && !$visibleInContext) {
                $contentContext->adoptNode($parentNode, $copyContent);
            }
        }
    }