diff --git a/src/ChangeRequestManager.php b/src/ChangeRequestManager.php index 76e2034..fee0a9a 100644 --- a/src/ChangeRequestManager.php +++ b/src/ChangeRequestManager.php @@ -53,10 +53,12 @@ public function findByQueryStringAndAggs($query, $from = 0, $size = 99999, $sort } $response = $this->fireRequest("POST", "/aggs?q={$query}&from={$from}&size={$size}&sort={$sort}", $body); + $response["hits"]["hits"] = array_map( function ($hit) { $change_todos = new ChangeTodos(); $change_todos->fromArray($hit); + return $change_todos; }, $response["hits"]["hits"]