services:
    bitbag_sylius_cms_plugin.controller.page_slug:
        class: BitBag\SyliusCmsPlugin\Controller\PageSlugController
        public: true
        arguments:
            - "@sylius.generator.slug"

    bitbag_sylius_cms_plugin.controller.action.admin.product_search:
        class: BitBag\SyliusCmsPlugin\Controller\Action\Admin\ProductSearchAction
        public: true
        arguments:
            - "@sylius.repository.product"
            - "@sylius.context.locale"
            - "@fos_rest.view_handler.default"

    bitbag_sylius_cms_plugin.controller.action.admin.taxon_search:
        class: BitBag\SyliusCmsPlugin\Controller\Action\Admin\TaxonSearchAction
        public: true
        arguments:
            - "@sylius.repository.taxon"
            - "@sylius.context.locale"
            - "@fos_rest.view_handler.default"

    bitbag_sylius_cms_plugin.controller.action.admin.import_data:
        class: BitBag\SyliusCmsPlugin\Controller\Action\Admin\ImportDataAction
        public: true
        arguments:
            - "@bitbag_sylius_cms_plugin.processor.import"
            - "@form.factory"
            - "@session.flash_bag"
            - "@bitbag_sylius_cms_plugin.controller.helper.form_errors_flash"
            - "@translator"
            - "@twig"

    bitbag_sylius_cms_plugin.controller.action.admin.upload_editor_image:
        class: BitBag\SyliusCmsPlugin\Controller\Action\Admin\UploadEditorImageAction
        public: true
        arguments:
            - "@bitbag_sylius_cms_plugin.resolver.media_provider"
            - "@bitbag_sylius_cms_plugin.repository.media"
            - "@bitbag_sylius_cms_plugin.factory.media"

    bitbag_sylius_cms_plugin.controller.helper.form_errors_flash:
        class: BitBag\SyliusCmsPlugin\Controller\Helper\FormErrorsFlashHelper
        public: true
        arguments:
            - "@session.flash_bag"
            - "@translator"

    bitbag_sylius_cms_plugin.controller.media.overriden:
        class: BitBag\SyliusCmsPlugin\Controller\MediaController
        public: true
        parent: "bitbag_sylius_cms_plugin.controller.media"
        calls:
            - setMediaProviderResolver: ["@bitbag_sylius_cms_plugin.resolver.media_provider"]
            - setMediaResourceResolver: ["@bitbag_sylius_cms_plugin.resolver.media_resource"]
            - setFormErrorsFlashHelper: ["@bitbag_sylius_cms_plugin.controller.helper.form_errors_flash"]
            - setCacheManager: ["@liip_imagine.cache.manager"]
            - setDataManager: ["@liip_imagine.data.manager"]

    bitbag_sylius_cms_plugin.controller.page.overriden:
        class: BitBag\SyliusCmsPlugin\Controller\PageController
        public: true
        parent: "bitbag_sylius_cms_plugin.controller.page"
        calls:
            - setPageResourceResolver: ["@bitbag_sylius_cms_plugin.resolver.page_resource"]
            - setFormErrorsFlashHelper: ["@bitbag_sylius_cms_plugin.controller.helper.form_errors_flash"]
            - setCacheManager: ["@liip_imagine.cache.manager"]
            - setDataManager: ["@liip_imagine.data.manager"]
