Doctrine\OXM\Mapping\Driver\AnnotationDriver::create PHP Method

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
    public static function create($paths = array(), AnnotationReader $reader = null)
    {
        if ($reader == null) {
            $reader = new AnnotationReader();
            $reader->setDefaultAnnotationNamespace('Doctrine\\OXM\\Mapping\\');
        }
        return new self($reader, $paths);
    }

Usage Example

示例#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);
 }
All Usage Examples Of Doctrine\OXM\Mapping\Driver\AnnotationDriver::create