File tree Expand file tree Collapse file tree 2 files changed +8
-9
lines changed
src/Jenssegers/Mongodb/Relations Expand file tree Collapse file tree 2 files changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -301,14 +301,14 @@ protected function buildDictionary(Collection $results)
301
301
// parents without having a possibly slow inner loops for every models.
302
302
$ dictionary = [];
303
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
- }
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
+ }
312
312
}
313
313
314
314
return $ dictionary ;
Original file line number Diff line number Diff line change @@ -31,6 +31,5 @@ protected function buildDictionary(Collection $results)
31
31
return $ results ->mapToDictionary (function ($ result ) use ($ foreign ) {
32
32
return [(string ) $ result ->{$ foreign } => $ result ];
33
33
})->all ();
34
-
35
34
}
36
35
}
You can’t perform that action at this time.
0 commit comments