예제 #1
0
 /**
  * Router and routeMatch are set here
  * 
  * @param RouteMatch|null $routeMatch
  */
 private function setupController($routeMatch = '')
 {
     $this->appServiceLoader->setController(new AdminController());
     $this->appServiceLoader->getController()->setEvent($this->event);
     $this->appServiceLoader->getController()->setServiceLocator($this->getServiceManager());
     $this->appServiceLoader->setService('request', $this->getServiceManager()->get('request'));
     $this->appServiceLoader->setService('router', $this->router);
     $this->appServiceLoader->setService('routeMatch', $routeMatch);
 }
예제 #2
0
 /**
  * @return \ModelModule\Service\AppServiceLoader
  */
 protected function recoverAppServiceLoader($channel = 1)
 {
     $sl = $this->getServiceLocator();
     $em = $sl->get('Doctrine\\ORM\\EntityManager');
     $sm = $sl->get('servicemanager');
     $appServiceLoader = new AppServiceLoader();
     $appServiceLoader->setProperties(array('serviceLocator' => $sl, 'serviceManager' => $sm, 'entityManager' => $em, 'queryBuilder' => $em->createQueryBuilder(), 'translator' => $sm->get('translator'), 'moduleConfigs' => $sm->get('config'), 'request' => $sm->get('request'), 'router' => $sm->get('request')));
     $appServiceLoader->recoverRouter();
     $appServiceLoader->recoverRouteMatch();
     $appServiceLoader->setService('channel', $channel);
     $appServiceLoader->setController($this);
     $appServiceLoader->setupParams();
     $appServiceLoader->setupRedirect();
     $appServiceLoader->setupConfigurations(new ConfigGetterWrapper(new ConfigGetter($em)), array());
     $appServiceLoader->setupUserInterfaceConfigurations(new UserInterfaceConfigurations($appServiceLoader->recoverService('configurations')));
     return $appServiceLoader;
 }