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
コード例 #1
0
ファイル: MarshallerTest.php プロジェクト: GromNaN/oxm
 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);
 }
コード例 #2
0
ファイル: XmlEntityManagerMock.php プロジェクト: doctrine/oxm
 /**
  * @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);
 }