/** * {@inheritdoc} */ public function loadOneToManyCollection(array $assoc, $sourceEntity, PersistentCollection $coll) { $persister = $this->uow->getCollectionPersister($assoc); $hasCache = $persister instanceof CachedPersister; if ($hasCache) { $ownerId = $this->uow->getEntityIdentifier($coll->getOwner()); $key = new CollectionCacheKey($assoc['sourceEntity'], $assoc['fieldName'], $ownerId); $list = $persister->loadCollectionCache($coll, $key); if ($list !== null) { if ($this->cacheLogger) { $this->cacheLogger->collectionCacheHit($persister->getCacheRegion()->getName(), $key); } return $list; } } $list = $this->persister->loadOneToManyCollection($assoc, $sourceEntity, $coll); if ($hasCache) { $persister->storeCollectionCache($key, $list); if ($this->cacheLogger) { $this->cacheLogger->collectionCacheMiss($persister->getCacheRegion()->getName(), $key); } } return $list; }