diff --git a/src/Grid/Service/ConfigurationService.php b/src/Grid/Service/ConfigurationService.php index e9875778..e1cf6afb 100644 --- a/src/Grid/Service/ConfigurationService.php +++ b/src/Grid/Service/ConfigurationService.php @@ -25,8 +25,8 @@ use Pimcore\Bundle\StudioBackendBundle\Grid\Hydrator\DetailedConfigurationHydratorInterface; use Pimcore\Bundle\StudioBackendBundle\Grid\Repository\ConfigurationRepositoryInterface; use Pimcore\Bundle\StudioBackendBundle\Grid\Schema\ColumnConfiguration; -use Pimcore\Bundle\StudioBackendBundle\Grid\Schema\Configuration; use Pimcore\Bundle\StudioBackendBundle\Grid\Schema\DetailedConfiguration; +use Pimcore\Bundle\StudioBackendBundle\Response\Collection; use Pimcore\Bundle\StudioBackendBundle\Security\Service\SecurityServiceInterface; use Symfony\Component\EventDispatcher\EventDispatcherInterface; use function count; @@ -82,10 +82,7 @@ public function getDefaultAssetGridConfiguration(): DetailedConfiguration return $detailedConfiguration; } - /** - * @return Configuration[] - */ - public function getGridConfigurationsForFolder(int $folderId): array + public function getGridConfigurationsForFolder(int $folderId): Collection { $configurations = $this->configurationRepository->getByAssetFolderId($folderId); @@ -104,7 +101,7 @@ public function getGridConfigurationsForFolder(int $folderId): array } } - return $filteredConfigurations; + return new Collection(count($filteredConfigurations), $filteredConfigurations); } public function getAssetGridConfiguration(?int $configurationId, int $folderId): DetailedConfiguration diff --git a/src/Grid/Service/ConfigurationServiceInterface.php b/src/Grid/Service/ConfigurationServiceInterface.php index 364b326f..39284274 100644 --- a/src/Grid/Service/ConfigurationServiceInterface.php +++ b/src/Grid/Service/ConfigurationServiceInterface.php @@ -16,8 +16,8 @@ namespace Pimcore\Bundle\StudioBackendBundle\Grid\Service; -use Pimcore\Bundle\StudioBackendBundle\Grid\Schema\Configuration; use Pimcore\Bundle\StudioBackendBundle\Grid\Schema\DetailedConfiguration; +use Pimcore\Bundle\StudioBackendBundle\Response\Collection; /** * @internal @@ -28,8 +28,5 @@ public function getDefaultAssetGridConfiguration(): DetailedConfiguration; public function getAssetGridConfiguration(?int $configurationId, int $folderId): DetailedConfiguration; - /** - * @return Configuration[] - */ - public function getGridConfigurationsForFolder(int $folderId): array; + public function getGridConfigurationsForFolder(int $folderId): Collection; }