Neos\Neos\Controller\CreateContentContextTrait::createContextMatchingNodeData PHP Method

createContextMatchingNodeData() protected method

Generates a Context that exactly fits the given NodeData Workspace, Dimensions & Site.
protected createContextMatchingNodeData ( NodeData $nodeData ) : ContentContext
$nodeData Neos\ContentRepository\Domain\Model\NodeData
return Neos\Neos\Domain\Service\ContentContext
    protected function createContextMatchingNodeData(NodeData $nodeData)
    {
        $nodePath = NodePaths::getRelativePathBetween(SiteService::SITES_ROOT_PATH, $nodeData->getPath());
        list($siteNodeName) = explode('/', $nodePath);
        $site = $this->siteRepository->findOneByNodeName($siteNodeName);
        $contextProperties = ['workspaceName' => $nodeData->getWorkspace()->getName(), 'invisibleContentShown' => true, 'inaccessibleContentShown' => true, 'removedContentShown' => true, 'dimensions' => $nodeData->getDimensionValues(), 'currentSite' => $site];
        if ($domain = $site->getFirstActiveDomain()) {
            $contextProperties['currentDomain'] = $domain;
        }
        return $this->_contextFactory->create($contextProperties);
    }