@@ -146,7 +146,7 @@ public function find($id, $columns = [])
146
146
* Execute the query as a "select" statement.
147
147
*
148
148
* @param array $columns
149
- * @return array|static[]
149
+ * @return array|static[]|Collection
150
150
*/
151
151
public function get ($ columns = [])
152
152
{
@@ -157,7 +157,7 @@ public function get($columns = [])
157
157
* Execute the query as a fresh "select" statement.
158
158
*
159
159
* @param array $columns
160
- * @return array|static[]
160
+ * @return array|static[]|Collection
161
161
*/
162
162
public function getFresh ($ columns = [])
163
163
{
@@ -259,7 +259,7 @@ public function getFresh($columns = [])
259
259
$ results = iterator_to_array ($ this ->collection ->aggregate ($ pipeline , $ options ));
260
260
261
261
// Return results
262
- return $ results ;
262
+ return new Collection ( $ results) ;
263
263
}
264
264
265
265
// Distinct query
@@ -274,7 +274,7 @@ public function getFresh($columns = [])
274
274
$ result = $ this ->collection ->distinct ($ column );
275
275
}
276
276
277
- return $ result ;
277
+ return new Collection ( $ result) ;
278
278
}
279
279
280
280
// Normal query
@@ -317,7 +317,7 @@ public function getFresh($columns = [])
317
317
$ cursor = $ this ->collection ->find ($ wheres , $ options );
318
318
319
319
// Return results as an array with numeric keys
320
- return iterator_to_array ($ cursor , false );
320
+ return new Collection ( iterator_to_array ($ cursor , false ) );
321
321
}
322
322
}
323
323
0 commit comments