diff --git a/lib/Doctrine/ORM/UnitOfWork.php b/lib/Doctrine/ORM/UnitOfWork.php index 3e19e53af..53596a671 100644 --- a/lib/Doctrine/ORM/UnitOfWork.php +++ b/lib/Doctrine/ORM/UnitOfWork.php @@ -1566,19 +1566,17 @@ class UnitOfWork implements PropertyChangedListener * * @ignore * - * @param string $idHash + * @param mixed $idHash (must be possible to cast it to string) * @param string $rootClassName * * @return object|bool The found entity or FALSE. */ public function tryGetByIdHash($idHash, $rootClassName) { - if (! is_string($idHash)) { - $idHash = (string) $idHash; - } + $stringIdHash = (string) $idHash; - if (isset($this->identityMap[$rootClassName][$idHash])) { - return $this->identityMap[$rootClassName][$idHash]; + if (isset($this->identityMap[$rootClassName][$stringIdHash])) { + return $this->identityMap[$rootClassName][$stringIdHash]; } return false;