From ca01065c6ad41eff9b5524522dc3686cf9e8709a Mon Sep 17 00:00:00 2001 From: Benjamin Eberlei Date: Wed, 19 Oct 2011 11:58:59 +0200 Subject: [PATCH] Bugfix in short identifier shortcut with association ids --- lib/Doctrine/ORM/Proxy/ProxyFactory.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/Doctrine/ORM/Proxy/ProxyFactory.php b/lib/Doctrine/ORM/Proxy/ProxyFactory.php index 05a44d992..490c3a119 100644 --- a/lib/Doctrine/ORM/Proxy/ProxyFactory.php +++ b/lib/Doctrine/ORM/Proxy/ProxyFactory.php @@ -230,10 +230,12 @@ class ProxyFactory */ private function isShortIdentifierGetter($method, $class) { + $identifier = lcfirst(substr($method->getName(), 3)); return ( $method->getNumberOfParameters() == 0 && substr($method->getName(), 0, 3) == "get" && - in_array(lcfirst(substr($method->getName(), 3)), $class->identifier, true) && + in_array($identifier, $class->identifier, true) && + $class->hasField($identifier) && (($method->getEndLine() - $method->getStartLine()) <= 4) ); }