protected function createContext($workspaceName) { $contextProperties = array('workspaceName' => $workspaceName, 'invisibleContentShown' => true, 'inaccessibleContentShown' => true); $currentDomain = $this->domainRepository->findOneByActiveRequest(); if ($currentDomain !== null) { $contextProperties['currentSite'] = $currentDomain->getSite(); $contextProperties['currentDomain'] = $currentDomain; } else { $contextProperties['currentSite'] = $this->siteRepository->findFirstOnline(); } return $this->contextFactory->create($contextProperties); }