Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

fixed DDC-1895 #389

Merged
merged 1 commit into from

3 participants

@Burgov

see #386

@guilhermeblanco guilhermeblanco merged commit 6093017 into from
@travisbot

This pull request fails (merged 64904c7 into 1023af6).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jul 4, 2012
  1. @Burgov

    fixed DDC-1895

    Burgov authored Burgov committed
This page is out of date. Refresh to see the latest.
Showing with 13 additions and 1 deletion.
  1. +13 −1 lib/Doctrine/ORM/Persisters/BasicEntityPersister.php
View
14 lib/Doctrine/ORM/Persisters/BasicEntityPersister.php
@@ -384,7 +384,19 @@ public function update($entity)
$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];
Something went wrong with that request. Please try again.