From b491902f1a58db6106526ae06c6349691b00c0dc Mon Sep 17 00:00:00 2001 From: agruhn Date: Mon, 6 Mar 2023 22:01:26 +0100 Subject: [PATCH] * adds filtering for ContactClient --- src/Contact/Client.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/Contact/Client.php b/src/Contact/Client.php index f86aac1..4b3ef5d 100644 --- a/src/Contact/Client.php +++ b/src/Contact/Client.php @@ -12,14 +12,21 @@ class Client extends PaginationClient public string $sortProperty = 'name'; + public array $filters = []; + /** * @param int $page * @return string */ public function generateUrl(int $page): string { - return parent::generateUrl($page) . - '&direction=' . $this->sortDirection . - '&property=' .$this->sortProperty; + $params = array_merge( + [ + 'direction' => $this->sortDirection, + 'property' => $this->sortProperty + ], + $this->filters + ); + return parent::generateUrl($page) . http_build_query($params); } }