Make page and pagesize optional
This commit is contained in:
1 parent
410906b2cd
commit
27ddeeacb5
1 file changed
+12
-5
@@ -13,12 +13,19 @@ class Customer
|
|||||||
/**
|
/**
|
||||||
* Get a list of all customers.
|
* Get a list of all customers.
|
||||||
*/
|
*/
|
||||||
public function all(int $page = 1, int $pageSize = 25): object
|
public function all(?int $page = null, ?int $pageSize = null): object
|
||||||
{
|
{
|
||||||
return $this->client->get('customers', [
|
$query = [];
|
||||||
'page' => $page,
|
|
||||||
'pageSize' => $pageSize,
|
if ($page !== null) {
|
||||||
]);
|
$query['page'] = $page;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($pageSize !== null) {
|
||||||
|
$query['pageSize'] = $pageSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->client->get('customers', $query);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function get(string $customerId): object
|
public function get(string $customerId): object
|
||||||
|
|||||||
Reference in new issue
Block a user