services:
  _defaults:
    public: true

  prestashop.adapter.shop.command_handler.upload_logos_handler:
    class: 'PrestaShop\PrestaShop\Adapter\Shop\CommandHandler\UploadLogosHandler'
    autoconfigure: true
    arguments:
      - '@prestashop.adapter.legacy.configuration'
      - '@prestashop.core.shop.logo_uploader'
      - '@prestashop.core.hook.dispatcher'

  prestashop.adapter.shop.url.base_url_provider:
    class: 'PrestaShop\PrestaShop\Adapter\Shop\Url\BaseUrlProvider'
    arguments:
      - "@=service('prestashop.adapter.legacy.context').getContext().link"

  prestashop.adapter.shop.url.help_provider:
    class: 'PrestaShop\PrestaShop\Adapter\Shop\Url\HelpProvider'
    arguments:
      - '@prestashop.adapter.legacy.context'
      - '@translator'
      - '@router'
      - '@PrestaShop\PrestaShop\Core\Help\Documentation'

  prestashop.adapter.shop.url.category_provider:
    class: 'PrestaShop\PrestaShop\Adapter\Shop\Url\CategoryProvider'
    arguments:
      - "@=service('prestashop.adapter.legacy.context').getContext().link"

  prestashop.adapter.shop.url.cms_provider:
    class: 'PrestaShop\PrestaShop\Adapter\Shop\Url\CmsProvider'
    arguments:
      - "@=service('prestashop.adapter.legacy.context').getContext().link"

  prestashop.adapter.shop.url.product_provider:
    class: 'PrestaShop\PrestaShop\Adapter\Shop\Url\ProductProvider'
    arguments:
      - '@=service("prestashop.adapter.legacy.context").getContext().link'

  prestashop.adapter.shop.url.product_preview_provider:
    class: 'PrestaShop\PrestaShop\Adapter\Shop\Url\ProductPreviewProvider'
    arguments:
      - "@=service('prestashop.adapter.legacy.context').getContext().link"
      - '@=service("prestashop.adapter.legacy.configuration").getBoolean("PS_REWRITING_SETTINGS")'
      - '@=service("prestashop.adapter.legacy.context").getContext().employee.id'

  prestashop.adapter.shop.query_handler.get_logos_paths_handler:
    class: 'PrestaShop\PrestaShop\Adapter\Shop\QueryHandler\GetLogosPathsHandler'
    autoconfigure: true
    arguments:
      - '@=service("prestashop.adapter.legacy.configuration").get("_PS_IMG_")'
      - '@=service("prestashop.adapter.legacy.configuration").get("_PS_IMG_DIR_")'

  prestashop.adapter.shop.query_handler.search_shops_handler:
    class: 'PrestaShop\PrestaShop\Adapter\Shop\QueryHandler\SearchShopsHandler'
    autoconfigure: true
    arguments:
      - '@prestashop.core.admin.shop.repository'
      - '@prestashop.core.admin.shop_group.repository'

  prestashop.adapter.shop.url.product_image_folder_provider:
    class: 'PrestaShop\PrestaShop\Adapter\Shop\Url\ImageFolderProvider'
    arguments:
      - "@=service('prestashop.adapter.legacy.context').getContext().link"
      - 'img/p'

  prestashop.adapter.shop.url.attribute_image_folder_provider:
    class: 'PrestaShop\PrestaShop\Adapter\Shop\Url\ImageFolderProvider'
    arguments:
      - "@=service('prestashop.adapter.legacy.context').getContext().link"
      - 'img/co'

  prestashop.adapter.shop.url.category_image_folder_provider:
    class: 'PrestaShop\PrestaShop\Adapter\Shop\Url\ImageFolderProvider'
    arguments:
      - "@=service('prestashop.adapter.legacy.context').getContext().link"
      - 'img/c'

  PrestaShop\PrestaShop\Adapter\Shop\Repository\ShopGroupRepository:
    arguments:
      - '@doctrine.dbal.default_connection'
      - '%database_prefix%'

  PrestaShop\PrestaShop\Adapter\Shop\Repository\ShopRepository:
    arguments:
      - '@doctrine.dbal.default_connection'
      - '%database_prefix%'
