services:
  _defaults:
    public: true

  prestashop.adapter.attachment.command_handler.delete_attachment_handler:
    public: true
    autoconfigure: true
    class: 'PrestaShop\PrestaShop\Adapter\Attachment\CommandHandler\DeleteAttachmentHandler'
    parent: 'prestashop.adapter.attachment.command_handler.abstract_attachment_handler'

  prestashop.adapter.attachment.command_handler.bulk_delete_attachment_handler:
    public: true
    autoconfigure: true
    class: 'PrestaShop\PrestaShop\Adapter\Attachment\CommandHandler\BulkDeleteAttachmentsHandler'
    parent: 'prestashop.adapter.attachment.command_handler.abstract_attachment_handler'

  prestashop.adapter.attachment.query_handler.get_attachment_handler:
    class: 'PrestaShop\PrestaShop\Adapter\Attachment\QueryHandler\GetAttachmentHandler'
    autoconfigure: true
    arguments:
      - !php/const _PS_DOWNLOAD_DIR_

  prestashop.adapter.contact.query_handler.get_attachment_handler:
    class: 'PrestaShop\PrestaShop\Adapter\Attachment\QueryHandler\GetAttachmentForEditingHandler'
    autoconfigure: true

  prestashop.adapter.attachment.uploader.attachment_file_uploader:
    class: 'PrestaShop\PrestaShop\Adapter\File\Uploader\AttachmentFileUploader'
    arguments:
      - '@prestashop.adapter.legacy.configuration'
      - '@prestashop.core.configuration.upload_size_configuration'

  prestashop.adapter.attachment.command_handler.abstract_attachment_handler:
    abstract: true
    class: 'PrestaShop\PrestaShop\Adapter\Attachment\AbstractAttachmentHandler'
    arguments:
      - '@validator'

  prestashop.adapter.attachment.command_handler.edit_attachment_handler:
    public: true
    autoconfigure: true
    class: 'PrestaShop\PrestaShop\Adapter\Attachment\CommandHandler\EditAttachmentHandler'
    parent: 'prestashop.adapter.attachment.command_handler.abstract_attachment_handler'
    arguments:
      - '@prestashop.adapter.attachment.uploader.attachment_file_uploader'

  prestashop.adapter.attachment.command_handler.create_attachment_handler:
    public: true
    autoconfigure: true
    class: 'PrestaShop\PrestaShop\Adapter\Attachment\CommandHandler\AddAttachmentHandler'
    parent: 'prestashop.adapter.attachment.command_handler.abstract_attachment_handler'
    arguments:
      - '@prestashop.adapter.attachment.uploader.attachment_file_uploader'

  PrestaShop\PrestaShop\Adapter\Attachment\AttachmentRepository:
    arguments:
      - '@doctrine.dbal.default_connection'
      - '%database_prefix%'

  prestashop.adapter.attachment.query_handler.get_attachment_information_handler:
    class: PrestaShop\PrestaShop\Adapter\Attachment\QueryHandler\GetAttachmentInformationHandler
    autoconfigure: true
    arguments:
      - '@PrestaShop\PrestaShop\Adapter\Attachment\AttachmentRepository'

  prestashop.adapter.attachment.query_handler.search_attachment_handler:
    class: PrestaShop\PrestaShop\Adapter\Attachment\QueryHandler\SearchAttachmentHandler
    autoconfigure: true
    arguments:
      - '@PrestaShop\PrestaShop\Adapter\Attachment\AttachmentRepository'
