1
0
mirror of synced 2024-12-05 03:06:05 +03:00

add string casting to id hashes

This commit is contained in:
Stefano Torresi 2015-03-17 17:59:47 +01:00 committed by Marco Pivetta
parent 41e873bd72
commit 2bdc1142fe

View File

@ -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];
}