Skip to content

Commit 562f45d

Browse files
committed
Fixed eager loading of nested relations #138
1 parent 74c9780 commit 562f45d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Jenssegers/Mongodb/Relations/EmbedsMany.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,11 @@ protected function toCollection(array $results = array())
364364
$models[] = $model;
365365
}
366366

367+
if (count($models) > 0)
368+
{
369+
$models = $this->eagerLoadRelations($models);
370+
}
371+
367372
return $this->related->newCollection($models);
368373
}
369374

0 commit comments

Comments
 (0)