Commit 460aeeb1 authored by beberlei's avatar beberlei

[2.0] Applied patch from DDC-76, LazyLoad AnnotationDriver in ORM Configuration.

parent a7847952
......@@ -53,12 +53,6 @@ class Configuration extends \Doctrine\DBAL\Configuration
'autoGenerateProxyClasses' => true,
'proxyNamespace' => null
));
//TODO: Move this to client code to avoid unnecessary work when a different metadata
// driver is used.
$reader = new \Doctrine\Common\Annotations\AnnotationReader(new \Doctrine\Common\Cache\ArrayCache);
$reader->setDefaultAnnotationNamespace('Doctrine\ORM\Mapping\\');
$this->_attributes['metadataDriverImpl'] = new \Doctrine\ORM\Mapping\Driver\AnnotationDriver($reader);
}
/**
......@@ -130,6 +124,12 @@ class Configuration extends \Doctrine\DBAL\Configuration
*/
public function getMetadataDriverImpl()
{
if($this->_attributes['metadataDriverImpl'] == null) {
$reader = new \Doctrine\Common\Annotations\AnnotationReader(new \Doctrine\Common\Cache\ArrayCache);
$reader->setDefaultAnnotationNamespace('Doctrine\ORM\Mapping\\');
$this->_attributes['metadataDriverImpl'] = new \Doctrine\ORM\Mapping\Driver\AnnotationDriver($reader);
}
return $this->_attributes['metadataDriverImpl'];
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment