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

Identity map check

This commit is contained in:
Asmir Mustafic 2015-01-29 22:16:25 +01:00 committed by Marco Pivetta
parent 5838115582
commit 7948b0c160

View File

@ -78,7 +78,13 @@ final class IdentifierFlattener
$targetClassMetadata = $this->metadataFactory->getMetadataFor(
$class->associationMappings[$field]['targetEntity']
);
$associatedId = $this->flattenIdentifier($targetClassMetadata, $this->unitOfWork->getEntityIdentifier($id[$field]));
if ($this->unitOfWork->isInIdentityMap($id[$field])) {
$associatedId = $this->flattenIdentifier($targetClassMetadata, $this->unitOfWork->getEntityIdentifier($id[$field]));
} else {
$associatedId = $this->flattenIdentifier($targetClassMetadata, $targetClassMetadata->getIdentifierValues($id[$field]));
}
$flatId[$field] = implode(' ', $associatedId);
} elseif (isset($class->associationMappings[$field])) {
$associatedId = array();
@ -90,7 +96,6 @@ final class IdentifierFlattener
$flatId[$field] = $id[$field];
}
}
return $flatId;
}