public function createService(ServiceLocatorInterface $serviceLocator)
 {
     $hydrator = new TenStreetHydrator(false);
     $parentlocator = $serviceLocator->getServiceLocator();
     $hydrator->addStrategy('DisplayFields', new DisplayFieldHydratorStrategy($parentlocator->get('DisplayFieldHydrator')));
     return $hydrator;
 }
 public function createService(ServiceLocatorInterface $serviceLocator)
 {
     $hydrator = new TenStreetHydrator(false);
     $parentlocator = $serviceLocator->getServiceLocator();
     $hydrator->addStrategy('PersonName', new SubEntityHydratorStrategy($parentlocator->get('PersonNameHydrator')));
     $hydrator->addStrategy('PostalAddress', new SubEntityHydratorStrategy($parentlocator->get('PostalAddressHydrator')));
     $hydrator->addStrategy('ContactData', new SubEntityHydratorStrategy($parentlocator->get('ContactDataHydrator')));
     return $hydrator;
 }
 public function createService(ServiceLocatorInterface $serviceLocator)
 {
     $hydrator = new TenStreetHydrator(false);
     $parentlocator = $serviceLocator->getServiceLocator();
     $hydrator->addStrategy('Authentication', new SubEntityHydratorStrategy($parentlocator->get('TenStreet\\Hydrator\\AuthenticationHydrator')));
     $hydrator->addStrategy('ApplicationData', new SubEntityHydratorStrategy($serviceLocator->get('TenStreet\\Hydrator\\ApplicationDataHydrator')));
     $hydrator->addStrategy('PersonalData', new SubEntityHydratorStrategy($serviceLocator->get('TenStreet\\Hydrator\\PersonalDataHydrator')));
     return $hydrator;
 }
Esempio n. 4
0
 public function getServiceConfig()
 {
     return array('factories' => array('OAuth2Server' => function ($sm) {
         return $sm->get('OAuth2Factory');
     }, 'OAuth2Factory' => function ($sm) {
         $oauth2Factory = $sm->get('ZF\\OAuth2\\Service\\OAuth2Server');
         $sm->setFactory('OAuth2FactoryInstance', $oauth2Factory);
         return $sm->get('OAuth2FactoryInstance');
     }, 'PersonNameHydrator' => function ($sm) {
         return new TenStreetHydrator(false);
     }, 'PostalAddressHydrator' => function ($sm) {
         return new TenStreetHydrator(false);
     }, 'PostalAddressHydrator' => function ($sm) {
         return new TenStreetHydrator(false);
     }, 'DisplayFieldHydrator' => function ($sm) {
         return new TenStreetHydrator(false);
     }, 'ContactDataHydrator' => function ($sm) {
         $hydrator = new TenStreetHydrator(false);
         $hydrator->addStrategy('PrimaryPhone', new PhoneNumberStrategy());
         $hydrator->setNamingStrategy(new MapperNamingStrategy(array('attributes' => '@attributes')));
         return $hydrator;
     }, 'AuthenticationHydrator' => function ($sm) {
         return new TenStreetHydrator(false);
     }, 'AuthTableGateway' => function ($sm) {
         $dbAdapter = $sm->get('Zend\\Db\\Adapter\\Adapter');
         $hydrator = $sm->get('AuthenticationHydrator');
         $entityPrototype = new AuthEntity();
         $resultset = new HydratingResultSet($hydrator, $entityPrototype);
         return new TableGateway('authentication', $dbAdapter, null, $resultset);
     }, 'TenStreet\\Model\\AuthTable' => function ($sm) {
         $tableGateway = $sm->get('AuthTableGateway');
         $table = new AuthTable($tableGateway, $sm);
         return $table;
     }, 'TenStreetDataMapper' => function ($sm) {
         $dbAdapter = $sm->get('Zend\\Db\\Adapter\\Adapter');
         return new TenStreetDataMapper($sm, $dbAdapter);
     }, 'Logger' => function ($sm) {
         $config = $sm->get('config');
         $logger = new \Zend\Log\Logger();
         if (isset($config['log']['file']) && is_writable(dirname($config['log']['file']))) {
             $writer = new \Zend\Log\Writer\Stream($config['log']['file']);
             $logger->addWriter($writer);
         }
         return $logger;
     }));
 }
Esempio n. 5
0
 public function getServiceConfig()
 {
     return array('factories' => array('OAuth2Server' => function ($sm) {
         return $sm->get('OAuth2Factory');
     }, 'OAuth2Factory' => function ($sm) {
         $oauth2Factory = $sm->get('ZF\\OAuth2\\Service\\OAuth2Server');
         $sm->setFactory('OAuth2FactoryInstance', $oauth2Factory);
         return $sm->get('OAuth2FactoryInstance');
     }, 'TenStreet\\Hydrator\\PersonNameHydrator' => function ($sm) {
         return new TenStreetHydrator(false);
     }, 'TenStreet\\Hydrator\\PostalAddressHydrator' => function ($sm) {
         return new TenStreetHydrator(false);
     }, 'TenStreet\\Hydrator\\DisplayFieldHydrator' => function ($sm) {
         return new TenStreetHydrator(false);
     }, 'TenStreet\\Hydrator\\LicenseHydrator' => function ($sm) {
         return new TenStreetHydrator(false);
     }, 'TenStreet\\Hydrator\\ContactDataHydrator' => function ($sm) {
         $hydrator = new TenStreetHydrator(false);
         $hydrator->addStrategy('PrimaryPhone', new PhoneNumberStrategy());
         $hydrator->setNamingStrategy(new MapperNamingStrategy(array('attributes' => '@attributes')));
         return $hydrator;
     }, 'TenStreet\\Hydrator\\AuthenticationHydrator' => function ($sm) {
         return new TenStreetHydrator(false);
     }, 'TenStreetDataMapper' => function ($sm) {
         $dbAdapter = $sm->get('Zend\\Db\\Adapter\\Adapter');
         return new TenStreetDataMapper($sm, $dbAdapter);
     }, 'Logger' => function ($sm) {
         $config = $sm->get('config');
         $logger = new \Zend\Log\Logger();
         if (isset($config['log']['file']) && is_writable(dirname($config['log']['file']))) {
             $writer = new \Zend\Log\Writer\Stream($config['log']['file']);
             $logger->addWriter($writer);
         }
         return $logger;
     }));
 }
 private function extract($object)
 {
     $hydrator = new TenStreetHydrator(false);
     return $hydrator->extract($object);
 }