Пример #1
0
 /**
  * Create a new EntityManager
  *
  * @param Storage       $storageDriver
  * @param Configuration $config
  */
 public function __construct(Storage $storageDriver, Configuration $config)
 {
     $cmf = new ClassMetadataFactory($config->getMappingDriverImpl());
     $cmf->setCacheDriver($config->getMetadataCache());
     $this->unitOfWork = new UnitOfWork($cmf, $storageDriver, $config);
     $this->storageDriver = $storageDriver;
 }
Пример #2
0
 public function testNoMappingDriver()
 {
     $config = new Configuration();
     $this->setExpectedException('Doctrine\\KeyValueStore\\KeyValueStoreException', 'No mapping driver was assigned to the configuration. Use $config->setMappingDriverImpl()');
     $config->getMappingDriverImpl();
 }