Skip to content

Commit

Permalink
API add getLastResult() for the full response
Browse files Browse the repository at this point in the history
  • Loading branch information
wilr authored Sep 2, 2021
1 parent b6f1fe4 commit 5020d83
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/Service/AlgoliaQuerier.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@
*/
class AlgoliaQuerier
{
/**
* @var array|null $lastResult
*/
protected $lastResult = null;

/**
* @param string $selectedIndex
* @param string $query
Expand Down Expand Up @@ -70,6 +75,8 @@ function array_key_first(array $arr)
}
}

$this->lastResult = $results;

$output = PaginatedList::create($records);

if ($results) {
Expand All @@ -82,4 +89,12 @@ function array_key_first(array $arr)

return $output;
}

/**
* @return array|null
*/
public function getLastResult()
{
return $this->lastResult;
}
}

0 comments on commit 5020d83

Please sign in to comment.