From 8ddcc4b270105f8ce48dc93c9c1a32f62a323b52 Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Sat, 17 Jan 2015 23:11:14 +0100 Subject: [PATCH] #954 DDC-2982 - No need to check if a `Region` is a `MultiGetRegion` --- .../ORM/Cache/DefaultCollectionHydrator.php | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/lib/Doctrine/ORM/Cache/DefaultCollectionHydrator.php b/lib/Doctrine/ORM/Cache/DefaultCollectionHydrator.php index 716bd846f..5ca1e59df 100644 --- a/lib/Doctrine/ORM/Cache/DefaultCollectionHydrator.php +++ b/lib/Doctrine/ORM/Cache/DefaultCollectionHydrator.php @@ -76,25 +76,18 @@ class DefaultCollectionHydrator implements CollectionHydrator public function loadCacheEntry(ClassMetadata $metadata, CollectionCacheKey $key, CollectionCacheEntry $entry, PersistentCollection $collection) { $assoc = $metadata->associationMappings[$key->association]; + /* @var $targetPersister \Doctrine\ORM\Cache\Persister\CachedPersister */ $targetPersister = $this->uow->getEntityPersister($assoc['targetEntity']); $targetRegion = $targetPersister->getCacheRegion(); $list = array(); - if ($targetRegion instanceof MultiGetRegion) { - $entityEntries = $targetRegion->getMulti($entry); + $entityEntries = $targetRegion->getMultiple($entry); - if ($entityEntries === null) { - return null; - } - } else { - $entityEntries = array(); - foreach ($entry->identifiers as $index => $identifier) { - if (null === ($entityEntries[$index] = $targetRegion->get($identifier))) { - return null; - } - } + if ($entityEntries === null) { + return null; } + /* @var $entityEntries \Doctrine\ORM\Cache\EntityCacheEntry[] */ foreach ($entityEntries as $index => $entityEntry) { $list[$index] = $this->uow->createEntity($entityEntry->class, $entityEntry->data, self::$hints); }