From fe7267d096b21f4292c865d91d5bf003e790c2d5 Mon Sep 17 00:00:00 2001 From: Kedar Khaire Date: Mon, 16 Oct 2023 17:50:42 +0530 Subject: [PATCH] Enhancements for query parameters (#311) --- .../Controller/PaginatedEntityListingControllerInterface.php | 5 ++++- .../Controller/PaginatedEntityListingControllerTrait.php | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Api/ApigeeX/Controller/PaginatedEntityListingControllerInterface.php b/src/Api/ApigeeX/Controller/PaginatedEntityListingControllerInterface.php index c2426ed0..af0f1aea 100644 --- a/src/Api/ApigeeX/Controller/PaginatedEntityListingControllerInterface.php +++ b/src/Api/ApigeeX/Controller/PaginatedEntityListingControllerInterface.php @@ -43,8 +43,11 @@ interface PaginatedEntityListingControllerInterface extends PaginatedEntityContr * Pager. * @param string $key_provider * Getter method on the entity that should provide a unique array key. + * @param array $queryparams + * Query parameters passed to the generator as $options['query']. This may + * be modified if there are extra parameters not used as route variables. * * @return \Apigee\Edge\Entity\EntityInterface[] */ - public function getEntities(PagerInterface $pager = null, string $key_provider = 'id'): array; + public function getEntities(PagerInterface $pager = null, string $key_provider = 'id', $queryparams = []): array; } diff --git a/src/Api/ApigeeX/Controller/PaginatedEntityListingControllerTrait.php b/src/Api/ApigeeX/Controller/PaginatedEntityListingControllerTrait.php index fcb73c07..257ed31b 100644 --- a/src/Api/ApigeeX/Controller/PaginatedEntityListingControllerTrait.php +++ b/src/Api/ApigeeX/Controller/PaginatedEntityListingControllerTrait.php @@ -32,9 +32,9 @@ trait PaginatedEntityListingControllerTrait * * @return \Apigee\Edge\Entity\EntityInterface[] */ - public function getEntities(PagerInterface $pager = null, string $key_provider = 'id'): array + public function getEntities(PagerInterface $pager = null, string $key_provider = 'id', $queryparams = []): array { - return $this->listEntities($pager, [], $key_provider); + return $this->listEntities($pager, $queryparams, $key_provider); } /**