Annotation driver uses getAssociationCacheDefaults for SLC mapping
This commit is contained in:
parent
11be4fae86
commit
f4f32a5213
1 changed files with 7 additions and 9 deletions
|
@ -273,7 +273,13 @@ class AnnotationDriver extends AbstractAnnotationDriver
|
|||
|
||||
$mapping = array();
|
||||
$mapping['fieldName'] = $property->getName();
|
||||
|
||||
// Evaluate @Cache annotation
|
||||
if (($cacheAnnot = $this->reader->getPropertyAnnotation($property, 'Doctrine\ORM\Mapping\Cache')) !== null) {
|
||||
$mapping['cache'] = $metadata->getAssociationCacheDefaults($mapping['fieldName'], array(
|
||||
'usage' => constant('Doctrine\ORM\Mapping\ClassMetadata::CACHE_USAGE_' . $cacheAnnot->usage),
|
||||
'region' => $cacheAnnot->region,
|
||||
));
|
||||
}
|
||||
// Check for JoinColumn/JoinColumns annotations
|
||||
$joinColumns = array();
|
||||
|
||||
|
@ -396,14 +402,6 @@ class AnnotationDriver extends AbstractAnnotationDriver
|
|||
$mapping['columnPrefix'] = $embeddedAnnot->columnPrefix;
|
||||
$metadata->mapEmbedded($mapping);
|
||||
}
|
||||
|
||||
// Evaluate @Cache annotation
|
||||
if (($cacheAnnot = $this->reader->getPropertyAnnotation($property, 'Doctrine\ORM\Mapping\Cache')) !== null) {
|
||||
$metadata->enableAssociationCache($mapping['fieldName'], array(
|
||||
'usage' => constant('Doctrine\ORM\Mapping\ClassMetadata::CACHE_USAGE_' . $cacheAnnot->usage),
|
||||
'region' => $cacheAnnot->region,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
// Evaluate AssociationOverrides annotation
|
||||
|
|
Loading…
Add table
Reference in a new issue