From 2bdc1142fe4c2ba5f49f7f7f16c43f06f829b9d7 Mon Sep 17 00:00:00 2001 From: Stefano Torresi Date: Tue, 17 Mar 2015 17:59:47 +0100 Subject: [PATCH] add string casting to id hashes --- lib/Doctrine/ORM/UnitOfWork.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/Doctrine/ORM/UnitOfWork.php b/lib/Doctrine/ORM/UnitOfWork.php index 0126bc628..3e19e53af 100644 --- a/lib/Doctrine/ORM/UnitOfWork.php +++ b/lib/Doctrine/ORM/UnitOfWork.php @@ -1573,6 +1573,10 @@ class UnitOfWork implements PropertyChangedListener */ public function tryGetByIdHash($idHash, $rootClassName) { + if (! is_string($idHash)) { + $idHash = (string) $idHash; + } + if (isset($this->identityMap[$rootClassName][$idHash])) { return $this->identityMap[$rootClassName][$idHash]; } @@ -2938,6 +2942,10 @@ class UnitOfWork implements PropertyChangedListener { $idHash = implode(' ', (array) $id); + if (! is_string($idHash)) { + $idHash = (string) $idHash; + } + if (isset($this->identityMap[$rootClassName][$idHash])) { return $this->identityMap[$rootClassName][$idHash]; }