Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

drop dependency on ORM from getRealClass(), but the fallback for earl…

…ier Doctrine versions is potentially problematic if the real class name ends in Proxy
  • Loading branch information...
commit 89bd12f913a96e76541955c77dd989b4c6bcb9ed 1 parent 2ea6965
@robocoder robocoder authored www-data committed
Showing with 5 additions and 5 deletions.
  1. +5 −5 lib/Doctrine/Common/DataFixtures/ProxyReferenceRepository.php
View
10 lib/Doctrine/Common/DataFixtures/ProxyReferenceRepository.php
@@ -40,15 +40,15 @@ protected function getRealClass($reference)
{
$className = get_class($reference);
- if ( ! $reference instanceof \Doctrine\ORM\Proxy\Proxy) {
- return $className;
+ if (\Doctrine\Common\Version::compare('2.2.0') === -1) {
+ return \Doctrine\Common\Util\ClassUtils::getRealClass($className);
}
- if (\Doctrine\Common\Version::compare('2.2.0') >= 0) {
- return \Doctrine\Common\Util\ClassUtils::getRealClass($className);
+ if (substr($className, -5) === 'Proxy') {
+ return substr($className, 0, -5);
}
- return substr($className, 0, -5);
+ return $className;
}
/**
Please sign in to comment.
Something went wrong with that request. Please try again.