Esempio n. 1
0
 /**
  * Creates a new EntityManager that operates on the given database connection
  * and uses the given Configuration and EventManager implementations.
  *
  * @param Doctrine\DBAL\Connection $conn
  * @param string $name
  * @param Doctrine\ORM\Configuration $config
  * @param Doctrine\Common\EventManager $eventManager
  */
 protected function __construct(Connection $conn, Configuration $config, EventManager $eventManager)
 {
     $this->_conn = $conn;
     $this->_config = $config;
     $this->_eventManager = $eventManager;
     $this->_metadataFactory = new ClassMetadataFactory($this->_config->getMetadataDriverImpl(), $this->_conn->getDatabasePlatform());
     $this->_metadataFactory->setCacheDriver($this->_config->getMetadataCacheImpl());
     $this->_unitOfWork = new UnitOfWork($this);
     $this->_proxyGenerator = new DynamicProxyGenerator($this, $this->_config->getCacheDir());
 }