/**
  * {@inheritDoc}
  *
  * @return DoctrineEntityManager
  */
 public function createService(ServiceLocatorInterface $sl)
 {
     /* @var $options EntityManager */
     $options = $this->getOptions($sl, 'entitymanager');
     // initializing the discriminator and relation map
     // @todo should actually attach it to a fetched event manager here, and not
     //       rely on its factory code
     $sl->get($options->getDiscriminatorMap());
     $sl->get($options->getInitializers());
     return parent::createService($sl);
 }
Exemple #2
0
 /**
  * Get Object Manager from Factory
  *
  * @return EntityManager
  */
 protected function getObjectManagerFromFactory()
 {
     $em = new EntityManagerFactory($this->getObjectManagerServiceName());
     return $em->createService($this->getServiceLocator());
 }