Skip to content

Commit c519f6d

Browse files
Gerry Vandermaesenjmikola
authored andcommitted
Fix build of lookup table for grouped ids
The ODM allows the use of custom types for identifier fields, however it currently uses the PHP value of an identifier as an array index key for grouping IDs together. This throws errors when the PHP value is a non-scalar.
1 parent ba003db commit c519f6d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/Doctrine/ODM/MongoDB/Persisters/DocumentPersister.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -664,7 +664,7 @@ private function loadReferenceManyCollectionOwningSide(PersistentCollection $col
664664

665665
// only query for the referenced object if it is not already initialized or the collection is sorted
666666
if (($reference instanceof Proxy && ! $reference->__isInitialized__) || $sorted) {
667-
$groupedIds[$className][$id] = $mongoId;
667+
$groupedIds[$className][] = $mongoId;
668668
}
669669
}
670670
foreach ($groupedIds as $className => $ids) {

0 commit comments

Comments
 (0)