Do not check at runtime for non-cacheable associations
This commit is contained in:
parent
c685255fe3
commit
11be4fae86
@ -266,10 +266,6 @@ class DefaultQueryCache implements QueryCache
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( ! isset($assoc['cache'])) {
|
|
||||||
throw CacheException::nonCacheableEntityAssociation($entityName, $name);
|
|
||||||
}
|
|
||||||
|
|
||||||
$assocPersister = $this->uow->getEntityPersister($assoc['targetEntity']);
|
$assocPersister = $this->uow->getEntityPersister($assoc['targetEntity']);
|
||||||
$assocRegion = $assocPersister->getCacheRegion();
|
$assocRegion = $assocPersister->getCacheRegion();
|
||||||
$assocMetadata = $assocPersister->getClassMetadata();
|
$assocMetadata = $assocPersister->getClassMetadata();
|
||||||
|
@ -234,14 +234,6 @@ abstract class AbstractEntityPersister implements CachedEntityPersister
|
|||||||
$class = $this->metadataFactory->getMetadataFor($className);
|
$class = $this->metadataFactory->getMetadataFor($className);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($class->containsForeignIdentifier) {
|
|
||||||
foreach ($class->associationMappings as $name => $assoc) {
|
|
||||||
if (!empty($assoc['id']) && !isset($assoc['cache'])) {
|
|
||||||
throw CacheException::nonCacheableEntityAssociation($class->name, $name);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$entry = $this->hydrator->buildCacheEntry($class, $key, $entity);
|
$entry = $this->hydrator->buildCacheEntry($class, $key, $entity);
|
||||||
$cached = $this->region->put($key, $entry);
|
$cached = $this->region->put($key, $entry);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user