Check for non-cacheable associations directly on the class metada info
This commit is contained in:
parent
6a428c6064
commit
c685255fe3
@ -28,6 +28,7 @@ use Doctrine\DBAL\Platforms\AbstractPlatform;
|
||||
use ReflectionClass;
|
||||
use Doctrine\Common\Persistence\Mapping\ClassMetadata;
|
||||
use Doctrine\Common\ClassLoader;
|
||||
use Doctrine\ORM\Cache\CacheException;
|
||||
|
||||
/**
|
||||
* A <tt>ClassMetadata</tt> instance holds all the object-relational mapping metadata
|
||||
@ -1486,6 +1487,10 @@ class ClassMetadataInfo implements ClassMetadata
|
||||
if ( ! $this->isIdentifierComposite && count($this->identifier) > 1) {
|
||||
$this->isIdentifierComposite = true;
|
||||
}
|
||||
|
||||
if ($this->cache && !isset($mapping['cache'])) {
|
||||
throw CacheException::nonCacheableEntityAssociation($this->name, $mapping['fieldName']);
|
||||
}
|
||||
}
|
||||
|
||||
// Mandatory attributes for both sides
|
||||
|
Loading…
x
Reference in New Issue
Block a user