@@ -13,7 +13,7 @@ class Builder extends EloquentBuilder {
13
13
*/
14
14
protected $ passthru = array (
15
15
'toSql ' , 'lists ' , 'insert ' , 'insertGetId ' , 'pluck ' ,
16
- 'count ' , 'min ' , 'max ' , 'avg ' , 'sum ' , 'exists ' , 'push ' , 'pull '
16
+ 'count ' , 'min ' , 'max ' , 'avg ' , 'sum ' , 'exists ' , 'push ' , 'pull ' ,
17
17
);
18
18
19
19
/**
@@ -174,7 +174,7 @@ protected function addHasWhere(EloquentBuilder $hasQuery, Relation $relation, $o
174
174
$ relationCount = array_count_values ($ query ->lists ($ relation ->getHasCompareKey ()));
175
175
176
176
// Remove unwanted related objects based on the operator and count.
177
- $ relationCount = array_filter ($ relationCount , function ($ counted ) use ($ count , $ operator )
177
+ $ relationCount = array_filter ($ relationCount , function ($ counted ) use ($ count , $ operator )
178
178
{
179
179
// If we are comparing to 0, we always need all results.
180
180
if ($ count == 0 ) return true ;
@@ -213,29 +213,29 @@ protected function addHasWhere(EloquentBuilder $hasQuery, Relation $relation, $o
213
213
* @return mixed
214
214
*/
215
215
public function raw ($ expression = null )
216
- {
217
- // Get raw results from the query builder.
218
- $ results = $ this ->query ->raw ($ expression );
216
+ {
217
+ // Get raw results from the query builder.
218
+ $ results = $ this ->query ->raw ($ expression );
219
219
220
- // Convert MongoCursor results to a collection of models.
221
- if ($ results instanceof MongoCursor)
222
- {
223
- $ results = iterator_to_array ($ results , false );
220
+ // Convert MongoCursor results to a collection of models.
221
+ if ($ results instanceof MongoCursor)
222
+ {
223
+ $ results = iterator_to_array ($ results , false );
224
224
225
- return $ this ->model ->hydrate ($ results );
226
- }
225
+ return $ this ->model ->hydrate ($ results );
226
+ }
227
227
228
- // The result is a single object.
229
- else if (is_array ($ results ) and array_key_exists ('_id ' , $ results ))
230
- {
231
- $ model = $ this ->model ->newFromBuilder ($ results );
228
+ // The result is a single object.
229
+ elseif (is_array ($ results ) and array_key_exists ('_id ' , $ results ))
230
+ {
231
+ $ model = $ this ->model ->newFromBuilder ($ results );
232
232
233
- $ model ->setConnection ($ this ->model ->getConnection ());
233
+ $ model ->setConnection ($ this ->model ->getConnection ());
234
234
235
- return $ model ;
236
- }
235
+ return $ model ;
236
+ }
237
237
238
- return $ results ;
239
- }
238
+ return $ results ;
239
+ }
240
240
241
241
}
0 commit comments