Commit 94928c5d authored by Jonathan H. Wage's avatar Jonathan H. Wage

[DDC-552] Fixing issue with getReflectionClass() not existing on...

[DDC-552] Fixing issue with getReflectionClass() not existing on ClassMetadataInfo when it is required by AnnotationDriver
parent 39a6c019
...@@ -41,13 +41,6 @@ use ReflectionClass, ReflectionProperty; ...@@ -41,13 +41,6 @@ use ReflectionClass, ReflectionProperty;
*/ */
class ClassMetadata extends ClassMetadataInfo class ClassMetadata extends ClassMetadataInfo
{ {
/**
* The ReflectionClass instance of the mapped class.
*
* @var ReflectionClass
*/
public $reflClass;
/** /**
* The ReflectionProperty instances of the mapped class. * The ReflectionProperty instances of the mapped class.
* *
...@@ -76,16 +69,6 @@ class ClassMetadata extends ClassMetadataInfo ...@@ -76,16 +69,6 @@ class ClassMetadata extends ClassMetadataInfo
$this->table['name'] = $this->reflClass->getShortName(); $this->table['name'] = $this->reflClass->getShortName();
} }
/**
* Gets the ReflectionClass instance of the mapped class.
*
* @return ReflectionClass
*/
public function getReflectionClass()
{
return $this->reflClass;
}
/** /**
* Gets the ReflectionPropertys of the mapped class. * Gets the ReflectionPropertys of the mapped class.
* *
......
...@@ -19,6 +19,8 @@ ...@@ -19,6 +19,8 @@
namespace Doctrine\ORM\Mapping; namespace Doctrine\ORM\Mapping;
use ReflectionClass;
/** /**
* A <tt>ClassMetadata</tt> instance holds all the object-relational mapping metadata * A <tt>ClassMetadata</tt> instance holds all the object-relational mapping metadata
* of an entity and it's associations. * of an entity and it's associations.
...@@ -366,6 +368,13 @@ class ClassMetadataInfo ...@@ -366,6 +368,13 @@ class ClassMetadataInfo
*/ */
public $versionField; public $versionField;
/**
* The ReflectionClass instance of the mapped class.
*
* @var ReflectionClass
*/
public $reflClass;
/** /**
* Initializes a new ClassMetadata instance that will hold the object-relational mapping * Initializes a new ClassMetadata instance that will hold the object-relational mapping
* metadata of the class with the given name. * metadata of the class with the given name.
...@@ -378,6 +387,19 @@ class ClassMetadataInfo ...@@ -378,6 +387,19 @@ class ClassMetadataInfo
$this->rootEntityName = $entityName; $this->rootEntityName = $entityName;
} }
/**
* Gets the ReflectionClass instance of the mapped class.
*
* @return ReflectionClass
*/
public function getReflectionClass()
{
if ( ! $this->reflClass) {
$this->reflClass = new ReflectionClass($entityName);
}
return $this->reflClass;
}
/** /**
* Sets the change tracking policy used by this class. * Sets the change tracking policy used by this class.
* *
......
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