/** * Adopt (translate) the given node and parents that are not yet visible to the given context * * @param NodeInterface $node * @param ContentContext $contentContext * @param boolean $copyContent 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() !== '/sites' && !$visibleInContext) { $contentContext->adoptNode($parentNode, $copyContent); } } }
/** * Adopt (translate) the given node and parents that are not yet visible to the given context * * @param NodeInterface $node * @param ContentContext $contentContext * @param boolean $copyContent 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); } } }