Skip to content

Commit

Permalink
Fix recursive function calls using set strategy and a repositoryMethod
Browse files Browse the repository at this point in the history
  • Loading branch information
rubenrua committed Aug 28, 2015
1 parent f88ad5c commit c40709e
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/Doctrine/ODM/MongoDB/Persisters/DocumentPersister.php
Expand Up @@ -778,9 +778,14 @@ public function createReferenceManyInverseSideQuery(PersistentCollection $collec
private function loadReferenceManyWithRepositoryMethod(PersistentCollection $collection)
{
$cursor = $this->createReferenceManyWithRepositoryMethodCursor($collection);
$mapping = $collection->getMapping();
$documents = $cursor->toArray(false);
foreach ($documents as $document) {
$collection->add($document);
foreach ($documents as $key => $obj) {
if (CollectionHelper::isHash($mapping['strategy'])) {
$collection->set($key, $obj);
} else {
$collection->add($obj);
}
}
}

Expand Down

0 comments on commit c40709e

Please sign in to comment.