コード例 #1
0
 /**
  * @param ServiceLocatorInterface $serviceLocator
  *
  * @return ContactService
  */
 public function createService(ServiceLocatorInterface $serviceLocator)
 {
     $contactService = new ContactService();
     $contactService->setServiceLocator($serviceLocator);
     /** @var EntityManager $entityManager */
     $entityManager = $serviceLocator->get(EntityManager::class);
     $contactService->setEntityManager($entityManager);
     /** @var AdminService $adminService */
     $adminService = $serviceLocator->get(AdminService::class);
     $contactService->setAdminService($adminService);
     /** @var ProjectService $projectService */
     $projectService = $serviceLocator->get(ProjectService::class);
     $contactService->setProjectService($projectService);
     /** @var OrganisationService $organisationService */
     $organisationService = $serviceLocator->get(OrganisationService::class);
     $contactService->setOrganisationService($organisationService);
     /** @var AddressService $addressService */
     $addressService = $serviceLocator->get(AddressService::class);
     $contactService->setAddressService($addressService);
     /** @var GeneralService $generalService */
     $generalService = $serviceLocator->get(GeneralService::class);
     $contactService->setGeneralService($generalService);
     /** @var DeeplinkService $deeplinkService */
     $deeplinkService = $serviceLocator->get(DeeplinkService::class);
     $contactService->setDeeplinkService($deeplinkService);
     /** @var ModuleOptions $moduleOptions */
     $moduleOptions = $serviceLocator->get(ModuleOptions::class);
     $contactService->setModuleOptions($moduleOptions);
     /** @var UserServiceOptionsInterface $zfcModuleOptions */
     $zfcModuleOptions = $serviceLocator->get('zfcuser_module_options');
     $contactService->setZfcUserOptions($zfcModuleOptions);
     return $contactService;
 }