Neos\Neos\Service\Controller\NodeController::createContext PHP Method

createContext() protected method

Create a Context for a workspace given by name to be used in this controller.
protected createContext ( string $workspaceName ) : Context
$workspaceName string Name of the current workspace
return Neos\ContentRepository\Domain\Service\Context
    protected function createContext($workspaceName)
    {
        $contextProperties = array('workspaceName' => $workspaceName);
        $currentDomain = $this->domainRepository->findOneByActiveRequest();
        if ($currentDomain !== null) {
            $contextProperties['currentSite'] = $currentDomain->getSite();
            $contextProperties['currentDomain'] = $currentDomain;
        }
        return $this->contextFactory->create($contextProperties);
    }