/** * @return \Doctrine\ORM\EntityManager */ public function createEntityManager($conn, OrmConf $config = null, $eventManager = null) { if (empty($config)) { $config = new OrmConf(); $config->setAutoCommit($this->autoCommit); $annotationDriver = $config->newDefaultAnnotationDriver($this->entitiesPaths); $config->setMetadataDriverImpl($annotationDriver); $config->setProxyDir($this->proxyDir); $config->setProxyNamespace($this->proxyNamespace); } return EntityManager::create($conn, $config, $eventManager); }