/**
  * @param  ServiceLocatorInterface $serviceLocator
  * @return HttpControllerMAnager
  */
 protected function getHttpControllerManager(ServiceLocatorInterface $serviceLocator)
 {
     if ($this->httpControllerManager === null) {
         $this->httpControllerManager = FactoryUtils::resolveServiceLocator($serviceLocator)->get('Ajasta\\Core\\Mvc\\Controller\\HttpControllerManager');
     }
     return $this->httpControllerManager;
 }
 /**
  * @param  ServiceLocatorInterface $serviceLocator
  * @return AdapterInterface
  */
 protected function getConsole(ServiceLocatorInterface $serviceLocator)
 {
     if ($this->console === null) {
         $this->console = FactoryUtils::resolveServiceLocator($serviceLocator)->get('Console');
     }
     return $this->console;
 }
 /**
  * @return AddressFieldValidator
  */
 public function createService(ServiceLocatorInterface $serviceLocator)
 {
     $serviceLocator = FactoryUtils::resolveServiceLocator($serviceLocator);
     if (!isset($this->options['field'])) {
         throw new RuntimeException('Missing option "field"');
     }
     return new AddressFieldValidator($serviceLocator->get('Ajasta\\Address\\Service\\AddressService'), $this->options['field']);
 }
Пример #4
0
 /**
  * @return InvoiceFieldset
  */
 public function createService(ServiceLocatorInterface $serviceLocator)
 {
     $serviceLocator = FactoryUtils::resolveServiceLocator($serviceLocator);
     $hydratorManager = $serviceLocator->get('HydratorManager');
     $fieldset = new InvoiceFieldset();
     $fieldset->setHydrator($hydratorManager->get('Ajasta\\Invoice\\Hydrator\\InvoiceHydrator'));
     return $fieldset;
 }
Пример #5
0
 /**
  * @return ClassMethodsHydrator
  */
 public function createService(ServiceLocatorInterface $serviceLocator)
 {
     $serviceLocator = FactoryUtils::resolveServiceLocator($serviceLocator);
     $objectManager = $serviceLocator->get('doctrine.entitymanager.orm_default');
     $hydrator = new ClassMethodsHydrator(false);
     $hydrator->addStrategy('client', new EntityStrategy($objectManager->getRepository('Ajasta\\Client\\Entity\\Client')));
     $hydrator->addStrategy('project', new EntityStrategy($objectManager->getRepository('Ajasta\\Client\\Entity\\Project')));
     $hydrator->addStrategy('issueDate', new DateStrategy());
     $hydrator->addStrategy('dueDate', new DateStrategy());
     return $hydrator;
 }
Пример #6
0
 /**
  * @return CountrySelect
  */
 public function createService(ServiceLocatorInterface $serviceLocator)
 {
     $serviceLocator = FactoryUtils::resolveServiceLocator($serviceLocator);
     return new CountrySelect($serviceLocator->get('Ajasta\\Address\\Service\\AddressService'), new CountryCodeFormatter($serviceLocator->get('Ajasta\\Locale')));
 }
 /**
  * @return UpdateAddressFormatsController
  */
 public function createService(ServiceLocatorInterface $serviceLocator)
 {
     $serviceLocator = FactoryUtils::resolveServiceLocator($serviceLocator);
     return new UpdateAddressFormatsController($serviceLocator->get('Ajasta\\Address\\Service\\MaintenanceService'));
 }
Пример #8
0
 /**
  * @return ClientSelect
  */
 public function createService(ServiceLocatorInterface $serviceLocator)
 {
     $serviceLocator = FactoryUtils::resolveServiceLocator($serviceLocator);
     return new ClientSelect($serviceLocator->get('Ajasta\\Client\\Repository\\ClientRepository'));
 }
Пример #9
0
 /**
  * @return ClientController
  */
 public function createService(ServiceLocatorInterface $serviceLocator)
 {
     $serviceLocator = FactoryUtils::resolveServiceLocator($serviceLocator);
     $formElementManager = $serviceLocator->get('FormElementManager');
     return new ClientController($serviceLocator->get('Ajasta\\Client\\Repository\\ClientRepository'), $serviceLocator->get('Ajasta\\Client\\Service\\ClientService'), $formElementManager->get('Ajasta\\Client\\Form\\ClientForm'));
 }
 /**
  * @return GetAddressFieldsForCountryController
  */
 public function createService(ServiceLocatorInterface $serviceLocator)
 {
     $serviceLocator = FactoryUtils::resolveServiceLocator($serviceLocator);
     return new GetAddressFieldsForCountryController($serviceLocator->get('Ajasta\\Address\\Service\\AddressService'));
 }
Пример #11
0
 /**
  * @return InvoiceOptions
  */
 public function createService(ServiceLocatorInterface $serviceLocator)
 {
     $serviceLocator = FactoryUtils::resolveServiceLocator($serviceLocator);
     return new InvoiceOptions($serviceLocator->get('Ajasta\\Invoice\\Options'));
 }
Пример #12
0
 /**
  * @return DisplayCurrency
  */
 public function createService(ServiceLocatorInterface $serviceLocator)
 {
     $serviceLocator = FactoryUtils::resolveServiceLocator($serviceLocator);
     return new DisplayCurrency(new CurrencyCodeFormatter($serviceLocator->get('Ajasta\\Locale')));
 }
Пример #13
0
 /**
  * @return AddressFormat
  */
 public function createService(ServiceLocatorInterface $serviceLocator)
 {
     $serviceLocator = FactoryUtils::resolveServiceLocator($serviceLocator);
     return new AddressFormat($serviceLocator->get('Ajasta\\Address\\Service\\AddressService'));
 }
Пример #14
0
 /**
  * @return InvoiceController
  */
 public function createService(ServiceLocatorInterface $serviceLocator)
 {
     $serviceLocator = FactoryUtils::resolveServiceLocator($serviceLocator);
     $formElementManager = $serviceLocator->get('FormElementManager');
     return new InvoiceController($serviceLocator->get('Ajasta\\Invoice\\Repository\\InvoiceRepository'), $serviceLocator->get('Ajasta\\Invoice\\Service\\InvoiceService'), $formElementManager->get('Ajasta\\Invoice\\Form\\InvoiceForm'), $serviceLocator->get('Ajasta\\Invoice\\Datatable\\Formatter'));
 }
Пример #15
0
 /**
  * @return AddressFieldset
  */
 public function createService(ServiceLocatorInterface $serviceLocator)
 {
     $serviceLocator = FactoryUtils::resolveServiceLocator($serviceLocator);
     $hydratorManager = $serviceLocator->get('HydratorManager');
     return new AddressFieldset($hydratorManager->get('Ajasta\\Address\\Hydrator\\AddressHydrator'));
 }
Пример #16
0
 /**
  * @return CurrencySelect
  */
 public function createService(ServiceLocatorInterface $serviceLocator)
 {
     $serviceLocator = FactoryUtils::resolveServiceLocator($serviceLocator);
     $options = $serviceLocator->get('Ajasta\\Core\\Options');
     return new LocaleSelect($options->getSelectableLocales(), $options->getDefaultLocale());
 }