File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -226,12 +226,12 @@ public function raw($expression = null)
226
226
// Convert Mongo BSONDocument to a single object.
227
227
elseif ($ results instanceof BSONDocument) {
228
228
$ results = $ results ->getArrayCopy ();
229
- return $ this ->model ->newFromBuilder ((array )$ results );
229
+ return $ this ->model ->newFromBuilder ((array ) $ results );
230
230
}
231
231
232
232
// The result is a single object.
233
233
elseif (is_array ($ results ) and array_key_exists ('_id ' , $ results )) {
234
- return $ this ->model ->newFromBuilder ((array )$ results );
234
+ return $ this ->model ->newFromBuilder ((array ) $ results );
235
235
}
236
236
237
237
return $ results ;
Original file line number Diff line number Diff line change @@ -267,7 +267,7 @@ public function getFresh($columns = [])
267
267
$ results = iterator_to_array ($ this ->collection ->aggregate ($ pipeline , $ options ));
268
268
269
269
// Return results
270
- return SHOULD_RETURN_COLLECTION ? new Collection ($ results ) : $ results ;
270
+ return $ this -> use_collection ? new Collection ($ results ) : $ results ;
271
271
}
272
272
273
273
// Distinct query
@@ -282,7 +282,7 @@ public function getFresh($columns = [])
282
282
$ result = $ this ->collection ->distinct ($ column );
283
283
}
284
284
285
- return SHOULD_RETURN_COLLECTION ? new Collection ($ result ) : $ result ;
285
+ return $ this -> use_collection ? new Collection ($ result ) : $ result ;
286
286
}
287
287
288
288
// Normal query
@@ -326,7 +326,7 @@ public function getFresh($columns = [])
326
326
327
327
// Return results as an array with numeric keys
328
328
$ results = iterator_to_array ($ cursor , false );
329
- return SHOULD_RETURN_COLLECTION ? new Collection ($ results ) : $ results ;
329
+ return $ this -> use_collection ? new Collection ($ results ) : $ results ;
330
330
}
331
331
}
332
332
@@ -1038,4 +1038,4 @@ public function __call($method, $parameters)
1038
1038
1039
1039
return parent ::__call ($ method , $ parameters );
1040
1040
}
1041
- }
1041
+ }
You can’t perform that action at this time.
0 commit comments