コード例 #1
0
 /**
  * {@inheritDoc}
  */
 public function isTransient($className)
 {
     if (strpos($className, self::NAME_SPACE) === 0) {
         return $this->builtinDriver->isTransient($className);
     }
     return $this->wrappedDriver->isTransient($className);
 }
コード例 #2
0
 /**
  * @param $fqn
  *
  * @return ClassMetadata
  */
 protected function getMetadataFor($fqn)
 {
     $cache = new ArrayCache();
     $reader = new AnnotationReader($cache);
     $annotationDriver = new AnnotationDriver($reader);
     $annotationDriver->addPaths(array(__DIR__ . '/Model'));
     $this->objectAdapterManager->getConfiguration()->setMetadataDriverImpl($annotationDriver);
     $cmf = new ClassMetadataFactory($this->objectAdapterManager);
     $meta = $cmf->getMetadataFor($fqn);
     return $meta;
 }
コード例 #3
0
 private function createObjectAdapterManager()
 {
     $configuration = new Configuration();
     $configuration->setManagers(array('reference-phpcr' => array('default' => $this->dm), 'reference-dbal-orm' => array('default' => $this->em)));
     $configuration->setClassMetadataFactoryName('Doctrine\\ORM\\ODMAdapter\\Mapping\\ClassMetadataFactory');
     $cache = new ArrayCache();
     $reader = new AnnotationReader($cache);
     $annotationDriver = new AnnotationDriver($reader);
     $annotationDriver->addPaths(array(__DIR__ . "/../../../Models"));
     $configuration->setMetadataDriverImpl($annotationDriver);
     $configuration->setProxyDir(__DIR__ . '/cache');
     $configuration->setAutoGenerateProxyClasses(true);
     $configuration->setProxyNamespace('__Test__');
     $configuration->setClassMetadataFactoryName('Doctrine\\ORM\\ODMAdapter\\Mapping\\ClassMetadataFactory');
     $this->objectAdapterManager = ObjectAdapterManager::create($configuration);
     $this->objectAdapterManager->addListenersToEventManagers();
 }