From a65996f74ccb703ea04ba83db2e55565fa01ad03 Mon Sep 17 00:00:00 2001 From: TR Date: Thu, 1 Nov 2012 23:59:57 +0000 Subject: [PATCH 1/3] notice is thrown up if no identifier values found wrapping the setting of value with an array_key_exists to prevent a notice from being thrown --- lib/Doctrine/ORM/Persisters/BasicEntityPersister.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php b/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php index 22ca06ea6..672a5afa0 100644 --- a/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php +++ b/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php @@ -1695,7 +1695,9 @@ class BasicEntityPersister $idValues = $class->getIdentifierValues($value); } - $value = $idValues[key($idValues)]; + if (array_key_exists(key($idValues), $idValues)){ + $value = $idValues[key($idValues)]; + } } return $value; From 185a0fb19c80e5ee28ff4c9d58209993b636aa62 Mon Sep 17 00:00:00 2001 From: TR Date: Fri, 2 Nov 2012 00:33:55 +0000 Subject: [PATCH 2/3] refactoring getIndividualValue for valid key value refactoring getIndividualValue --- lib/Doctrine/ORM/Persisters/BasicEntityPersister.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php b/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php index 672a5afa0..40b7f09d9 100644 --- a/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php +++ b/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php @@ -1695,9 +1695,10 @@ class BasicEntityPersister $idValues = $class->getIdentifierValues($value); } - if (array_key_exists(key($idValues), $idValues)){ - $value = $idValues[key($idValues)]; - } + $key = key($idValues); + if (null !== $key){ + $value = $idValues[$key]; + } } return $value; From 73e61640962a90f0794663357bd1650ce2db200c Mon Sep 17 00:00:00 2001 From: TR Date: Sat, 3 Nov 2012 09:47:08 +0000 Subject: [PATCH 3/3] Update lib/Doctrine/ORM/Persisters/BasicEntityPersister.php coding standards change --- lib/Doctrine/ORM/Persisters/BasicEntityPersister.php | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php b/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php index 40b7f09d9..a80f8bc9a 100644 --- a/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php +++ b/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php @@ -1696,6 +1696,7 @@ class BasicEntityPersister } $key = key($idValues); + if (null !== $key){ $value = $idValues[$key]; }