imports:
  - { resource: grid/*.yml }

parameters:
  prestashop.core.grid.data.factory.doctrine_grid_data_factory: PrestaShop\PrestaShop\Core\Grid\Data\Factory\DoctrineGridDataFactory

services:
  _defaults:
    public: true

  prestashop.core.grid.presenter.grid_presenter:
    class: 'PrestaShop\PrestaShop\Core\Grid\Presenter\GridPresenter'
    arguments:
      - '@prestashop.core.hook.dispatcher'

  prestashop.core.grid.query.doctrine_query_parser:
    class: 'PrestaShop\PrestaShop\Core\Grid\Query\DoctrineQueryParser'

  prestashop.core.query.doctrine_search_criteria_applicator:
    class: 'PrestaShop\PrestaShop\Core\Grid\Query\DoctrineSearchCriteriaApplicator'

  # Grid position updater
  PrestaShop\PrestaShop\Core\Grid\Position\PositionUpdateFactory:
    public: true
    arguments:
      - 'positions'
      - 'rowId'
      - 'oldPosition'
      - 'newPosition'
      - 'parentId'

  PrestaShop\PrestaShop\Core\Grid\Position\PositionUpdateFactoryInterface: '@PrestaShop\PrestaShop\Core\Grid\Position\PositionUpdateFactory'

  prestashop.core.grid.position.position_update_factory:
    alias: 'PrestaShop\PrestaShop\Core\Grid\Position\PositionUpdateFactory'
    deprecated: ~

  prestashop.core.grid.position.update_handler.doctrine_position_update_handler:
    class: 'PrestaShop\PrestaShop\Core\Grid\Position\UpdateHandler\DoctrinePositionUpdateHandler'
    arguments:
      - '@doctrine.dbal.default_connection'
      - '%database_prefix%'

  PrestaShop\PrestaShop\Core\Grid\Position\GridPositionUpdater:
    public: true
    arguments:
      - '@prestashop.core.grid.position.update_handler.doctrine_position_update_handler'

  PrestaShop\PrestaShop\Core\Grid\Position\GridPositionUpdaterInterface: '@PrestaShop\PrestaShop\Core\Grid\Position\GridPositionUpdater'

  prestashop.core.grid.position.doctrine_grid_position_updater:
    alias: PrestaShop\PrestaShop\Core\Grid\Position\GridPositionUpdater
    deprecated: ~

  prestashop.core.grid.query.filter.doctrine_filter_applicator:
    class: 'PrestaShop\PrestaShop\Core\Grid\Query\Filter\DoctrineFilterApplicator'
