Neos.Neos/Classes/Controller/CreateContentContextTrait.php
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 ($site instanceof Site && $domain = $site->getFirstActiveDomain()) {
            $contextProperties['currentDomain'] = $domain;
        }

        return $this->_contextFactory->create($contextProperties);
    }
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 ($site instanceof Site && $domain = $site->getFirstActiveDomain()) {
            $contextProperties['currentDomain'] = $domain;
        }

        return $this->_contextFactory->create($contextProperties);
    }
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 ( $ site instanceof Site && $ domain = $ site -> getFirstActiveDomain ( ) ) { $ contextProperties [ 'currentDomain' ] = $ domain ; } return $ this -> _contextFactory -> create ( $ contextProperties ) ; }
Generates a Context that exactly fits the given NodeData Workspace, Dimensions & Site.

@param NodeData $nodeData
@return ContentContext
Generates a Context that exactly fits the given NodeData Workspace Dimensions & Site .