/** * To be used only in Adapters. Should not been called by Core classes. Prefer to use Core\context class, * that will contains all you need in the Core architecture * * @throws LogicException If legacy context is not set properly * * @return Context The Legacy context, for Adapter use only. */ public function getContext() { static $legacyContext = null; if (null === $legacyContext) { $legacyContext = OldContext::getContext(); if ($legacyContext && !empty($legacyContext->shop) && !isset($legacyContext->controller) && isset($legacyContext->employee)) { //init real legacy shop context $adminController = new \AdminControllerCore(); $adminController->initShopContext(); } } return $legacyContext; }