1
0
mirror of synced 2025-02-10 01:09:26 +03:00

YAML driver uses getAssociationCacheDefaults for SLC mapping

This commit is contained in:
Asmir Mustafic 2015-06-20 13:41:24 +02:00
parent 7d64be915c
commit acbda4bc0e

View File

@ -388,12 +388,12 @@ class YamlDriver extends FileDriver
$mapping['orphanRemoval'] = (bool)$oneToOneElement['orphanRemoval']; $mapping['orphanRemoval'] = (bool)$oneToOneElement['orphanRemoval'];
} }
$metadata->mapOneToOne($mapping);
// Evaluate second level cache // Evaluate second level cache
if (isset($oneToOneElement['cache'])) { if (isset($oneToOneElement['cache'])) {
$metadata->enableAssociationCache($mapping['fieldName'], $this->cacheToArray($oneToOneElement['cache'])); $mapping['cache'] = $metadata->getAssociationCacheDefaults($mapping['fieldName'], $this->cacheToArray($oneToOneElement['cache']));
} }
$metadata->mapOneToOne($mapping);
} }
} }
@ -426,12 +426,13 @@ class YamlDriver extends FileDriver
$mapping['indexBy'] = $oneToManyElement['indexBy']; $mapping['indexBy'] = $oneToManyElement['indexBy'];
} }
$metadata->mapOneToMany($mapping);
// Evaluate second level cache // Evaluate second level cache
if (isset($oneToManyElement['cache'])) { if (isset($oneToManyElement['cache'])) {
$metadata->enableAssociationCache($mapping['fieldName'], $this->cacheToArray($oneToManyElement['cache'])); $mapping['cache'] = $metadata->getAssociationCacheDefaults($mapping['fieldName'], $this->cacheToArray($oneToManyElement['cache']));
} }
$metadata->mapOneToMany($mapping);
} }
} }
@ -475,12 +476,12 @@ class YamlDriver extends FileDriver
$mapping['cascade'] = $manyToOneElement['cascade']; $mapping['cascade'] = $manyToOneElement['cascade'];
} }
$metadata->mapManyToOne($mapping);
// Evaluate second level cache // Evaluate second level cache
if (isset($manyToOneElement['cache'])) { if (isset($manyToOneElement['cache'])) {
$metadata->enableAssociationCache($mapping['fieldName'], $this->cacheToArray($manyToOneElement['cache'])); $mapping['cache'] = $metadata->getAssociationCacheDefaults($mapping['fieldName'], $this->cacheToArray($manyToOneElement['cache']));
} }
$metadata->mapManyToOne($mapping);
} }
} }
@ -552,12 +553,12 @@ class YamlDriver extends FileDriver
$mapping['orphanRemoval'] = (bool)$manyToManyElement['orphanRemoval']; $mapping['orphanRemoval'] = (bool)$manyToManyElement['orphanRemoval'];
} }
$metadata->mapManyToMany($mapping);
// Evaluate second level cache // Evaluate second level cache
if (isset($manyToManyElement['cache'])) { if (isset($manyToManyElement['cache'])) {
$metadata->enableAssociationCache($mapping['fieldName'], $this->cacheToArray($manyToManyElement['cache'])); $mapping['cache'] = $metadata->getAssociationCacheDefaults($mapping['fieldName'], $this->cacheToArray($manyToManyElement['cache']));
} }
$metadata->mapManyToMany($mapping);
} }
} }