diff --git a/lib/Doctrine/ORM/Cache/Region/DefaultRegion.php b/lib/Doctrine/ORM/Cache/Region/DefaultRegion.php index 324e27544..3f214d0b0 100644 --- a/lib/Doctrine/ORM/Cache/Region/DefaultRegion.php +++ b/lib/Doctrine/ORM/Cache/Region/DefaultRegion.php @@ -105,13 +105,14 @@ class DefaultRegion implements Region $result = array(); foreach ($collection->identifiers as $key) { - $entry = $this->cache->fetch($this->getCacheEntryKey($key)); - if ($entry === false) { - $result = null; - break; - } else { - $result[] = $entry; + $entryKey = $this->getCacheEntryKey($key); + $entryValue = $this->cache->fetch($entryKey); + + if ($entryValue === false) { + return null; } + + $result[] = $entryValue; } return $result;