Пример #1
0
 /**
  * @return DocumentManager
  */
 public function getDocumentManager()
 {
     $factory = new DocumentManagerFactory();
     $sm = Bootstrap::getServiceManager();
     $sm->setAllowOverride(true);
     $config = $sm->get('Config');
     $c = new Config(['eoko' => ['odm' => ['hydrator' => ['class' => 'Zend\\Stdlib\\Hydrator\\ClassMethods', 'strategies' => ['Eoko\\ODM\\Metadata\\Annotation\\DateTime' => new DateTimeFormatterStrategy()]]]]]);
     $c->merge(new Config($config));
     $sm->setService('Config', $c->toArray());
     return $factory->createService($sm);
 }
 private function getClassMetadata()
 {
     return new ClassMetadata(UserEntity::class, Bootstrap::getServiceManager()->get('Eoko\\ODM\\Metadata\\Annotation'));
 }