From d1e868a32ae8e61d8cfd70afb0d5750ada489a0e Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Sat, 31 Mar 2012 23:26:33 +0200 Subject: [PATCH] Removing registration of proxy ClassMetadata by the proxyFactory Ensuring that functionality is kept by checking for the real class name in the ClassMetadataFactory --- lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php | 3 +++ lib/Doctrine/ORM/Proxy/ProxyFactory.php | 4 ---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php b/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php index 2aaa30a44..f6e8a52e3 100644 --- a/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php +++ b/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php @@ -24,6 +24,7 @@ use ReflectionException, Doctrine\ORM\EntityManager, Doctrine\DBAL\Platforms, Doctrine\ORM\Events, + Doctrine\Common\Util\ClassUtils, Doctrine\Common\Persistence\Mapping\RuntimeReflectionService, Doctrine\Common\Persistence\Mapping\ReflectionService, Doctrine\Common\Persistence\Mapping\ClassMetadataFactory as ClassMetadataFactoryInterface; @@ -168,6 +169,8 @@ class ClassMetadataFactory implements ClassMetadataFactoryInterface return $this->loadedMetadata[$realClassName]; } + } else { + $realClassName = ClassUtils::getRealClass($realClassName); } if ($this->cacheDriver) { diff --git a/lib/Doctrine/ORM/Proxy/ProxyFactory.php b/lib/Doctrine/ORM/Proxy/ProxyFactory.php index 21d033e7e..df10798e1 100644 --- a/lib/Doctrine/ORM/Proxy/ProxyFactory.php +++ b/lib/Doctrine/ORM/Proxy/ProxyFactory.php @@ -93,10 +93,6 @@ class ProxyFactory require $fileName; } - if ( ! $this->_em->getMetadataFactory()->hasMetadataFor($fqn)) { - $this->_em->getMetadataFactory()->setMetadataFor($fqn, $this->_em->getClassMetadata($className)); - } - $entityPersister = $this->_em->getUnitOfWork()->getEntityPersister($className); return new $fqn($entityPersister, $identifier);