Handling composite keys on non cache-able entities
This commit is contained in:
parent
24dd0c6a55
commit
d72ad9cc50
1 changed files with 13 additions and 1 deletions
|
@ -92,7 +92,19 @@ class DefaultEntityHydrator implements EntityHydrator
|
||||||
unset($data[$name]);
|
unset($data[$name]);
|
||||||
|
|
||||||
foreach ($associationIds as $fieldName => $fieldValue) {
|
foreach ($associationIds as $fieldName => $fieldValue) {
|
||||||
$data[$assoc['targetToSourceKeyColumns'][$targetClassMetadata->getColumnName($fieldName)]] = $fieldValue;
|
|
||||||
|
if (isset($targetClassMetadata->associationMappings[$fieldName])){
|
||||||
|
$targetAssoc = $targetClassMetadata->associationMappings[$fieldName];
|
||||||
|
|
||||||
|
foreach($assoc['targetToSourceKeyColumns'] as $referencedColumn => $localColumn) {
|
||||||
|
|
||||||
|
if (isset($targetAssoc['sourceToTargetKeyColumns'][$referencedColumn])) {
|
||||||
|
$data[$localColumn] = $fieldValue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
$data[$assoc['targetToSourceKeyColumns'][$targetClassMetadata->columnNames[$fieldName]]] = $fieldValue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
|
|
Loading…
Add table
Reference in a new issue