1
0
mirror of synced 2024-12-05 03:06:05 +03:00

Resolve association entries on multi get cache

This commit is contained in:
Asmir Mustafic 2015-02-03 00:27:02 +01:00 committed by Marco Pivetta
parent cb52782e5e
commit 8eea7c86f7
3 changed files with 2 additions and 8 deletions

View File

@ -89,7 +89,7 @@ class DefaultCollectionHydrator implements CollectionHydrator
/* @var $entityEntries \Doctrine\ORM\Cache\EntityCacheEntry[] */
foreach ($entityEntries as $index => $entityEntry) {
$list[$index] = $this->uow->createEntity($entityEntry->class, $entityEntry->data, self::$hints);
$list[$index] = $this->uow->createEntity($entityEntry->class, $entityEntry->resolveAssociationEntries($this->em), self::$hints);
}
array_walk($list, function($entity, $index) use ($collection) {

View File

@ -2625,10 +2625,6 @@ class UnitOfWork implements PropertyChangedListener
if ($joinColumnValue !== null) {
if ($targetClass->containsForeignIdentifier) {
if ($joinColumnValue instanceof AssociationCacheEntry) {
$joinColumnValue = implode(' ', $joinColumnValue->identifier);
}
$associatedId[$targetClass->getFieldForColumn($targetColumn)] = $joinColumnValue;
} else {
$associatedId[$targetClass->fieldNames[$targetColumn]] = $joinColumnValue;

View File

@ -72,9 +72,7 @@ final class IdentifierFlattener
$flatId = array();
foreach ($class->identifier as $field) {
if (isset($class->associationMappings[$field]) && isset($id[$field]) && $id[$field] instanceof \Doctrine\ORM\Cache\AssociationCacheEntry) {
$flatId[$field] = implode(' ', $id[$field]->identifier);
} elseif (isset($class->associationMappings[$field]) && isset($id[$field]) && is_object($id[$field])) {
if (isset($class->associationMappings[$field]) && isset($id[$field]) && is_object($id[$field])) {
$targetClassMetadata = $this->metadataFactory->getMetadataFor(
$class->associationMappings[$field]['targetEntity']
);