예제 #1
0
 public function __invoke(\Interop\Container\ContainerInterface $container, $requestedName, array $options = null)
 {
     /* @var $db DbStorage */
     $db = parent::__invoke($container, DbStorage::class, $options);
     $services = $container;
     if ($services instanceof AbstractPluginManager) {
         $services = $services->getServiceLocator();
     }
     $db->setServiceManager($services);
     return $db;
 }
 public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
 {
     $services = $container;
     if ($services instanceof AbstractPluginManager) {
         $services = $services->getServiceLocator();
     }
     $hydratorManager = $services->get('HydratorManager');
     $doctrineHydrator = $hydratorManager->get(DoctrineHydrator::class);
     $fieldset = parent::__invoke($container, $requestedName, $options);
     $fieldset->setHydrator($doctrineHydrator);
     return $fieldset;
 }