Merge pull request #389 from SamsonIT/fix_fetch_relation_by_id_of_association_field_2_3
fixed DDC-1895
This commit is contained in:
commit
6093017bc6
@ -384,7 +384,19 @@ class BasicEntityPersister
|
||||
$targetMapping = $this->_em->getClassMetadata($this->_class->associationMappings[$idField]['targetEntity']);
|
||||
$where[] = $this->_class->associationMappings[$idField]['joinColumns'][0]['name'];
|
||||
$params[] = $id[$idField];
|
||||
$types[] = $targetMapping->fieldMappings[$targetMapping->identifier[0]]['type'];
|
||||
|
||||
switch (true) {
|
||||
case (isset($targetMapping->fieldMappings[$targetMapping->identifier[0]])):
|
||||
$types[] = $targetMapping->fieldMappings[$targetMapping->identifier[0]]['type'];
|
||||
break;
|
||||
|
||||
case (isset($targetMapping->associationMappings[$targetMapping->identifier[0]])):
|
||||
$types[] = $targetMapping->associationMappings[$targetMapping->identifier[0]]['type'];
|
||||
break;
|
||||
|
||||
default:
|
||||
throw ORMException::unrecognizedField($targetMapping->identifier[0]);
|
||||
}
|
||||
} else {
|
||||
$where[] = $this->quoteStrategy->getColumnName($idField, $this->_class, $this->_platform);
|
||||
$params[] = $id[$idField];
|
||||
|
Loading…
x
Reference in New Issue
Block a user