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

Store column values of not cache-able associations

This commit is contained in:
Asmir Mustafic 2015-02-11 15:56:19 +01:00
parent ed6fa0deb4
commit 58e20c70c6

View File

@ -73,8 +73,15 @@ class DefaultEntityHydrator implements EntityHydrator
}
if ( ! isset($assoc['cache']) || ! ($assoc['type'] & ClassMetadata::TO_ONE)) {
$associatedEntity = $data[$name];
unset($data[$name]);
if ($this->uow->isInIdentityMap($associatedEntity)) {
$targetEntityMetadata = $this->em->getClassMetadata($assoc['targetEntity']);
foreach ($this->uow->getEntityIdentifier($associatedEntity) as $fieldName => $fieldValue) {
$data[$assoc['targetToSourceKeyColumns'][$targetEntityMetadata->getColumnName($fieldName)]] = $fieldValue;
}
}
continue;
}