From 4b589c839b2b2be2d4199fb083271ea2ed709cb1 Mon Sep 17 00:00:00 2001 From: mattamon Date: Fri, 12 Apr 2024 12:53:42 +0200 Subject: [PATCH] Remove constructor params and fix collection getter --- .../Api/Assets/CollectionController.php | 2 -- .../Api/DataObjects/CollectionController.php | 2 +- .../Filter/Loader/TaggedIteratorAdapter.php | 36 +++++++++++++++++++ 3 files changed, 37 insertions(+), 3 deletions(-) create mode 100644 src/Service/Filter/Loader/TaggedIteratorAdapter.php diff --git a/src/Controller/Api/Assets/CollectionController.php b/src/Controller/Api/Assets/CollectionController.php index 0b072d22e..b66d6b4f3 100644 --- a/src/Controller/Api/Assets/CollectionController.php +++ b/src/Controller/Api/Assets/CollectionController.php @@ -36,7 +36,6 @@ use Pimcore\Bundle\StudioApiBundle\Service\AssetSearchServiceInterface; use Pimcore\Bundle\StudioApiBundle\Service\Filter\FilterServiceInterface; use Pimcore\Bundle\StudioApiBundle\Service\GenericData\V1\AssetQuery; -use Pimcore\Bundle\StudioApiBundle\Service\GenericData\V1\AssetQueryProviderInterface; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpKernel\Attribute\MapQueryString; use Symfony\Component\Routing\Attribute\Route; @@ -48,7 +47,6 @@ final class CollectionController extends AbstractApiController public function __construct( SerializerInterface $serializer, - private readonly AssetQueryProviderInterface $assetQueryProvider, private readonly AssetSearchServiceInterface $assetSearchService, private readonly FilterServiceInterface $filterService ) { diff --git a/src/Controller/Api/DataObjects/CollectionController.php b/src/Controller/Api/DataObjects/CollectionController.php index c1d3b7b72..66b105dab 100644 --- a/src/Controller/Api/DataObjects/CollectionController.php +++ b/src/Controller/Api/DataObjects/CollectionController.php @@ -47,7 +47,7 @@ public function getAssets(#[MapQueryString] Collection $collection): JsonRespons $dataObjectQuery = $this->getDataQuery() ->setPage($collection->getPage()) - ->setPageSize($collection->getLimit()) + ->setPageSize($collection->getPageSize()) ->setClassDefinitionId('EV'); $result = $this->dataObjectSearchService->searchDataObjects($dataObjectQuery); diff --git a/src/Service/Filter/Loader/TaggedIteratorAdapter.php b/src/Service/Filter/Loader/TaggedIteratorAdapter.php new file mode 100644 index 000000000..2a821854a --- /dev/null +++ b/src/Service/Filter/Loader/TaggedIteratorAdapter.php @@ -0,0 +1,36 @@ +taggedServices]; + } +}