imports:
  - { resource: ./data_provider_common.yml }

services:
  _defaults:
    public: true

  prestashop.adapter.admin.data_provider.module:
    class: PrestaShop\PrestaShop\Adapter\Module\AdminModuleDataProvider
    arguments:
      - "@prestashop.categories_provider"
      - "@prestashop.adapter.data_provider.module"
      - "@=service('prestashop.adapter.legacy.context').getContext().employee"
    calls:
      - [ setRouter, [ '@router' ] ]
    decorates: prestashop.core.admin.data_provider.module_interface
    public: false

  prestashop.adapter.data_provider.supplier:
    class: PrestaShop\PrestaShop\Adapter\Supplier\SupplierDataProvider
    deprecated: ~

  prestashop.adapter.data_provider.warehouse:
    class: PrestaShop\PrestaShop\Adapter\Warehouse\WarehouseDataProvider
    deprecated: ~

  prestashop.adapter.data_provider.category:
    class: PrestaShop\PrestaShop\Adapter\Category\CategoryDataProvider
    arguments: [ "@=service('prestashop.adapter.legacy.context')" ]

  prestashop.adapter.data_provider.group:
    class: PrestaShop\PrestaShop\Adapter\Group\GroupDataProvider

  prestashop.adapter.data_provider.tax:
    class: PrestaShop\PrestaShop\Adapter\Tax\TaxRuleDataProvider
    deprecated: ~

  prestashop.adapter.data_provider.manufacturer:
    class: PrestaShop\PrestaShop\Adapter\Manufacturer\ManufacturerDataProvider

  prestashop.adapter.data_provider.product:
    class: PrestaShop\PrestaShop\Adapter\Product\ProductDataProvider
    deprecated: ~

  prestashop.adapter.data_provider.attachment:
    class: PrestaShop\PrestaShop\Adapter\Product\AttachmentDataProvider
    deprecated: ~

  prestashop.adapter.data_provider.feature:
    class: PrestaShop\PrestaShop\Adapter\Feature\FeatureDataProvider
    deprecated: ~

  prestashop.adapter.data_provider.carrier:
    class: PrestaShop\PrestaShop\Adapter\Carrier\CarrierDataProvider
    arguments: [ '@prestashop.adapter.legacy.configuration' ]

  prestashop.adapter.data_provider.order_invoice:
    class: PrestaShop\PrestaShop\Adapter\Invoice\OrderInvoiceDataProvider

  prestashop.adapter.data_provider.order_state:
    class: PrestaShop\PrestaShop\Adapter\OrderState\OrderStateDataProvider

  prestashop.adapter.data_provider.order_return_state:
    class: PrestaShop\PrestaShop\Adapter\OrderReturnState\OrderReturnStateDataProvider

  prestashop.adapter.data_provider.attribute:
    class: PrestaShop\PrestaShop\Adapter\Attribute\AttributeDataProvider

  prestashop.adapter.data_provider.customer:
    class: PrestaShop\PrestaShop\Adapter\Customer\CustomerDataProvider

  prestashop.adapter.data_provider.combination:
    class: PrestaShop\PrestaShop\Adapter\CombinationDataProvider
    arguments:
      - "@prestashop.core.localization.locale.context_locale"
    deprecated: ~

  prestashop.adapter.data_provider.cms:
    class: PrestaShop\PrestaShop\Adapter\CMS\CMSDataProvider

  prestashop.adapter.data_provider.pack:
    class: PrestaShop\PrestaShop\Adapter\Pack\PackDataProvider
    deprecated: ~

  prestashop.adapter.data_provider.tab:
    alias: PrestaShop\PrestaShop\Adapter\Tab\TabDataProvider
    deprecated: ~
    public: true

  PrestaShop\PrestaShop\Adapter\Tab\TabDataProvider:
    class: PrestaShop\PrestaShop\Adapter\Tab\TabDataProvider
    public: false
    autowire: true
    arguments:
      - '@prestashop.adapter.legacy.context'
      - '@prestashop.adapter.legacy.configuration'

  prestashop.adapter.data_provider.profile:
    class: PrestaShop\PrestaShop\Adapter\Profile\ProfileDataProvider
    arguments:
      - '@prestashop.adapter.data_provider.employee'
      - '@=service("prestashop.adapter.legacy.configuration").getInt("_PS_ADMIN_PROFILE_")'

  prestashop.adapter.data_provider.module:
    class: PrestaShop\PrestaShop\Adapter\Module\ModuleDataProvider
    arguments: [ "@prestashop.adapter.legacy.logger", "@translator", "@doctrine.orm.entity_manager" ]
    calls:
      - [ "setEmployeeId", [ "@=service('prestashop.adapter.legacy.context').getContext().employee?service('prestashop.adapter.legacy.context').getContext().employee.id:0" ] ]

  prestashop.categories_provider:
    class: PrestaShopBundle\Service\DataProvider\Admin\CategoriesProvider
    arguments:
      - "%prestashop.addons.categories%"
      - "@=service('prestashop.adapter.legacy.context').getContext().shop.theme_name?service('prestashop.core.addon.theme.repository').getInstanceByName(service('prestashop.adapter.legacy.context').getContext().shop.theme_name).getModulesToEnable():[]"

  prestashop.adapter.data_provider.default_route:
    class: PrestaShop\PrestaShop\Adapter\Routes\DefaultRouteProvider

  prestashop.adapter.data_provider.employee:
    class: PrestaShop\PrestaShop\Adapter\Employee\ContextEmployeeProvider
    arguments:
      - '@=service("prestashop.adapter.legacy.context").getContext().employee'
