Skip to content

Commit

Permalink
Fixed bug in XMLDriver where relation indexes are treathed as element…
Browse files Browse the repository at this point in the history
…s but documented as attributes.
  • Loading branch information
guilhermeblanco authored and beberlei committed Oct 31, 2011
1 parent 7d0d06c commit 5c4e3d9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -322,8 +322,8 @@ public function loadMetadataForClass($className, ClassMetadataInfo $metadata)
$mapping['orderBy'] = $orderBy;
}

if (isset($oneToManyElement->{'index-by'})) {
$mapping['indexBy'] = (string)$oneToManyElement->{'index-by'};
if (isset($oneToManyElement['index-by'])) {
$mapping['indexBy'] = (string)$oneToManyElement['index-by'];
}

$metadata->mapOneToMany($mapping);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
<join-column name="address_id" referenced-column-name="id" on-delete="CASCADE" on-update="CASCADE"/>
</one-to-one>

<one-to-many field="phonenumbers" target-entity="Phonenumber" mapped-by="user" orphan-removal="true">
<one-to-many field="phonenumbers" target-entity="Phonenumber" mapped-by="user" index-by="number" orphan-removal="true">
<cascade>
<cascade-persist/>
</cascade>
Expand Down

0 comments on commit 5c4e3d9

Please sign in to comment.