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 40e719d commit c6c7d9fCopy full SHA for c6c7d9f
src/Query.php
@@ -920,10 +920,10 @@ function setModel($model)
920
protected function getAll($result = [])
921
{
922
923
- $new = [];
924
-
925
if (array_key_exists("hits", $result)) {
926
+ $new = [];
+
927
foreach ($result["hits"]["hits"] as $row) {
928
929
$model = $this->model ? new $this->model($row["_source"], true) : new Model($row["_source"], true);
@@ -951,9 +951,13 @@ protected function getAll($result = [])
951
$new->scroll_id = isset($result["_scroll_id"]) ? $result["_scroll_id"] : NULL;
952
$new->shards = (object)$result["_shards"];
953
954
- }
+ return $new;
955
956
- return $new;
+ } else {
957
958
+ return new Collection([]);
959
960
+ }
961
}
962
963
/**
0 commit comments