mirror of
https://github.com/jonathan-martz/pocketbase-php-sdk.git
synced 2026-04-02 23:17:43 +00:00
Adding queryParams in curl call
using http_build_query()
we can simply pass the parameters describe in the Api doc.
ex : $this->pb->collection('coolCollection')->getFullList(200,['filter'=> $filter])
It can be used for all other function.
This commit is contained in:
@@ -40,7 +40,8 @@ class Collection
|
||||
public function getFullList(int $batch = 200, array $queryParams = [])
|
||||
{
|
||||
$ch = curl_init();
|
||||
curl_setopt($ch, CURLOPT_URL, $this->url . "/api/collections/" . $this->collection . "/records");
|
||||
$getParams = !empty($queryParams) ? http_build_query($queryParams) : "";
|
||||
curl_setopt($ch, CURLOPT_URL, $this->url . "/api/collections/" . $this->collection . "/records?".$getParams);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
||||
if (self::$token != '') {
|
||||
$headers = array(
|
||||
|
||||
Reference in New Issue
Block a user