We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 206f0f9 commit c29b3a3Copy full SHA for c29b3a3
src/Jenssegers/Mongodb/Relations/BelongsToMany.php
@@ -301,14 +301,14 @@ protected function buildDictionary(Collection $results)
301
// parents without having a possibly slow inner loops for every models.
302
$dictionary = [];
303
304
- foreach ($results as $result) {
305
- foreach ($result->$foreign as $item) {
306
- if (is_array($item)) {
307
- $dictionary[$item['_id']][] = $result;
308
- } else {
309
- $dictionary[$item][] = $result;
310
- }
311
+ foreach ($results as $result) {
+ foreach ($result->$foreign as $item) {
+ if (is_array($item)) {
+ $dictionary[$item['_id']][] = $result;
+ } else {
+ $dictionary[$item][] = $result;
+ }
312
}
313
314
return $dictionary;
0 commit comments