Exemplo n.º 1
0
 /**
  * 
  * @param StorageInterface $storageDriver
  * @param Configuration $config
  * @param EventManager $eventManager
  */
 public function __construct(StorageInterface $storageDriver, Configuration $config, EventManager $eventManager = null)
 {
     $this->storageDriver = $storageDriver;
     $this->config = $config;
     $this->eventManager = $eventManager ?: new EventManager();
     $metadataFactoryClassName = $this->config->getClassMetadataFactoryClassName();
     $this->metadataFactory = new $metadataFactoryClassName();
     $this->metadataFactory->setEntityManager($this);
     $this->metadataFactory->setCacheDriver($this->config->getMetadataCacheImpl());
     $this->unitOfWork = new UnitOfWork($this);
 }
Exemplo n.º 2
0
 public function testMetadataCacheImpl()
 {
     $config = new Configuration();
     $config->setMetadataCacheImpl(new ArrayCache());
     $this->assertInstanceOf('Doctrine\\Common\\Cache\\ArrayCache', $config->getMetadataCacheImpl());
 }