diff --git a/config/admin/services.yml b/config/admin/services.yml index 4dd6898..9a0df89 100644 --- a/config/admin/services.yml +++ b/config/admin/services.yml @@ -6,3 +6,21 @@ services: PrestaShop\Module\APIResources\List\ModuleQueryBuilder: parent: 'prestashop.core.grid.abstract_query_builder' autowire: true + + prestashop.core.grid.data_factory.hook: + class: '%prestashop.core.grid.data.factory.doctrine_grid_data_factory%' + public: true + arguments: + - '@prestashop.core.api.query_builder.hook' + - '@prestashop.core.hook.dispatcher' + - '@prestashop.core.grid.query.doctrine_query_parser' + - 'hook' + + prestashop.core.grid.data_factory.module: + class: '%prestashop.core.grid.data.factory.doctrine_grid_data_factory%' + public: true + arguments: + - '@PrestaShop\Module\APIResources\List\ModuleQueryBuilder' + - '@prestashop.core.hook.dispatcher' + - '@prestashop.core.grid.query.doctrine_query_parser' + - 'module' diff --git a/src/ApiPlatform/Resources/ApiClient/ApiClientList.php b/src/ApiPlatform/Resources/ApiClient/ApiClientList.php index 2f274ab..4a6b424 100644 --- a/src/ApiPlatform/Resources/ApiClient/ApiClientList.php +++ b/src/ApiPlatform/Resources/ApiClient/ApiClientList.php @@ -41,7 +41,7 @@ '[client_name]' => '[clientName]', '[external_issuer]' => '[externalIssuer]', ], - queryBuilder: ApiClientQueryBuilder::class, + gridDataFactory: 'prestashop.core.grid.data_factory.api_client', filtersClass: ApiClientFilters::class, filtersMapping: [ '[apiClientId]' => '[id_api_client]', diff --git a/src/ApiPlatform/Resources/Hook.php b/src/ApiPlatform/Resources/Hook.php index 3f6272b..6cc884b 100644 --- a/src/ApiPlatform/Resources/Hook.php +++ b/src/ApiPlatform/Resources/Hook.php @@ -80,7 +80,7 @@ provider: QueryListProvider::class, scopes: ['hook_read'], ApiResourceMapping: ['[id_hook]' => '[id]'], - queryBuilder: 'prestashop.core.api.query_builder.hook', + gridDataFactory: 'prestashop.core.grid.data_factory.hook', ), ], )] diff --git a/src/ApiPlatform/Resources/Module/Module.php b/src/ApiPlatform/Resources/Module/Module.php index 09e43ba..eb56cf4 100644 --- a/src/ApiPlatform/Resources/Module/Module.php +++ b/src/ApiPlatform/Resources/Module/Module.php @@ -43,7 +43,7 @@ scopes: [ 'module_read', ], - queryBuilder: ModuleQueryBuilder::class, + gridDataFactory: 'prestashop.core.grid.data_factory.module', ), ], )] diff --git a/src/ApiPlatform/Resources/ProductList.php b/src/ApiPlatform/Resources/ProductList.php index 46ea8b3..8d2076d 100644 --- a/src/ApiPlatform/Resources/ProductList.php +++ b/src/ApiPlatform/Resources/ProductList.php @@ -25,6 +25,7 @@ use ApiPlatform\Metadata\ApiProperty; use ApiPlatform\Metadata\ApiResource; +use PrestaShop\PrestaShop\Adapter\Product\Grid\Data\Factory\ProductGridDataFactoryDecorator; use PrestaShop\PrestaShop\Core\Domain\Product\Exception\ProductNotFoundException; use PrestaShop\PrestaShop\Core\Domain\Shop\Exception\ShopAssociationNotFound; use PrestaShop\PrestaShop\Core\Search\Filters\ProductFilters; @@ -42,7 +43,7 @@ '[id_product]' => '[productId]', '[final_price_tax_excluded]' => '[price]', ], - queryBuilder: 'prestashop.core.grid.query_builder.product', + gridDataFactory: ProductGridDataFactoryDecorator::class, filtersClass: ProductFilters::class, ), ],