Resolve association entries on multi get cache
This commit is contained in:
parent
cb52782e5e
commit
8eea7c86f7
3 changed files with 2 additions and 8 deletions
|
@ -89,7 +89,7 @@ class DefaultCollectionHydrator implements CollectionHydrator
|
||||||
|
|
||||||
/* @var $entityEntries \Doctrine\ORM\Cache\EntityCacheEntry[] */
|
/* @var $entityEntries \Doctrine\ORM\Cache\EntityCacheEntry[] */
|
||||||
foreach ($entityEntries as $index => $entityEntry) {
|
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) {
|
array_walk($list, function($entity, $index) use ($collection) {
|
||||||
|
|
|
@ -2625,10 +2625,6 @@ class UnitOfWork implements PropertyChangedListener
|
||||||
|
|
||||||
if ($joinColumnValue !== null) {
|
if ($joinColumnValue !== null) {
|
||||||
if ($targetClass->containsForeignIdentifier) {
|
if ($targetClass->containsForeignIdentifier) {
|
||||||
if ($joinColumnValue instanceof AssociationCacheEntry) {
|
|
||||||
$joinColumnValue = implode(' ', $joinColumnValue->identifier);
|
|
||||||
}
|
|
||||||
|
|
||||||
$associatedId[$targetClass->getFieldForColumn($targetColumn)] = $joinColumnValue;
|
$associatedId[$targetClass->getFieldForColumn($targetColumn)] = $joinColumnValue;
|
||||||
} else {
|
} else {
|
||||||
$associatedId[$targetClass->fieldNames[$targetColumn]] = $joinColumnValue;
|
$associatedId[$targetClass->fieldNames[$targetColumn]] = $joinColumnValue;
|
||||||
|
|
|
@ -72,9 +72,7 @@ final class IdentifierFlattener
|
||||||
$flatId = array();
|
$flatId = array();
|
||||||
|
|
||||||
foreach ($class->identifier as $field) {
|
foreach ($class->identifier as $field) {
|
||||||
if (isset($class->associationMappings[$field]) && isset($id[$field]) && $id[$field] instanceof \Doctrine\ORM\Cache\AssociationCacheEntry) {
|
if (isset($class->associationMappings[$field]) && isset($id[$field]) && is_object($id[$field])) {
|
||||||
$flatId[$field] = implode(' ', $id[$field]->identifier);
|
|
||||||
} elseif (isset($class->associationMappings[$field]) && isset($id[$field]) && is_object($id[$field])) {
|
|
||||||
$targetClassMetadata = $this->metadataFactory->getMetadataFor(
|
$targetClassMetadata = $this->metadataFactory->getMetadataFor(
|
||||||
$class->associationMappings[$field]['targetEntity']
|
$class->associationMappings[$field]['targetEntity']
|
||||||
);
|
);
|
||||||
|
|
Loading…
Add table
Reference in a new issue