Skip to content

Commit

Permalink
Merge pull request #389 from SamsonIT/fix_fetch_relation_by_id_of_ass…
Browse files Browse the repository at this point in the history
…ociation_field_2_3

fixed DDC-1895
  • Loading branch information
guilhermeblanco committed Jul 4, 2012
2 parents 1023af6 + 64904c7 commit 6093017
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion lib/Doctrine/ORM/Persisters/BasicEntityPersister.php
Expand Up @@ -384,7 +384,19 @@ protected final function _updateTable($entity, $quotedTableName, array $updateDa
$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];
Expand Down

0 comments on commit 6093017

Please sign in to comment.