create() public static method

Factory method for the Annotation Driver
public static create ( array | string $paths = [], AnnotationReader $reader = null ) : AnnotationDriver
$paths array | string
$reader Doctrine\Common\Annotations\AnnotationReader
return AnnotationDriver
Esempio n. 1
0
 public function setUp()
 {
     $config = new Configuration();
     $config->setMetadataDriverImpl(AnnotationDriver::create("tests/Doctrine/Tests/OXM/Entities"));
     $config->setMetadataCacheImpl(new \Doctrine\Common\Cache\ArrayCache());
     $this->metadataFactory = new ClassMetadataFactory($config);
     $this->marshaller = new XmlMarshaller($this->metadataFactory);
 }
Esempio n. 2
0
 /**
  * @static
  * @param \Doctrine\OXM\Storage\Storage|null $storage
  * @param \Doctrine\OXM\Configuration|null $config
  * @param \Doctrine\Common\EventManager|null $eventManager
  * @return XmlEntityManagerMock
  */
 public static function create(\Doctrine\OXM\Storage\Storage $storage = null, \Doctrine\OXM\Configuration $config = null, \Doctrine\Common\EventManager $eventManager = null)
 {
     if (is_null($storage)) {
         $storage = new \Doctrine\OXM\Storage\FileSystemStorage(__DIR__ . '/../Workspace');
     }
     if (is_null($config)) {
         $config = new \Doctrine\OXM\Configuration();
         $config->setMetadataDriverImpl(\Doctrine\OXM\Mapping\Driver\AnnotationDriver::create(__DIR__ . '/../OXM/Entities'));
     }
     if (is_null($eventManager)) {
         $eventManager = new \Doctrine\Common\EventManager();
     }
     return new XmlEntityManagerMock($storage, $config, $eventManager);
 }