mirror of
https://github.com/jonathan-martz/pocketbase-php-sdk.git
synced 2026-04-03 07:27:42 +00:00
fix getFullList batch bug
This commit is contained in:
@@ -91,12 +91,14 @@ class Collection
|
|||||||
* @param array $queryParams
|
* @param array $queryParams
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function getFullList(int $batch = 200, array $queryParams = []): array
|
public function getFullList(array $queryParams, int $batch = 200): array
|
||||||
{
|
{
|
||||||
$queryParams = [... $queryParams, ['perPage' => $batch]];
|
$queryParams = [... $queryParams, 'perPage'=> $batch];
|
||||||
$getParams = !empty($queryParams) ? http_build_query($queryParams) : "";
|
$getParams = !empty($queryParams) ? http_build_query($queryParams) : "";
|
||||||
$response = $this->doRequest($this->url . "/api/collections/" . $this->collection . "/records?" . $getParams, 'GET');
|
$response = $this->doRequest($this->url . "/api/collections/" . $this->collection . "/records?" . $getParams, 'GET');
|
||||||
|
|
||||||
|
var_dump($response);
|
||||||
|
|
||||||
return json_decode($response, JSON_FORCE_OBJECT);
|
return json_decode($response, JSON_FORCE_OBJECT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user