services:
    oro_catalog.layout.block_type.category:
        parent: oro_layout.block_type.abstract_configurable_container
        calls:
            - [setOptionsConfig, [{category: {required: true}}]]
            - [setName, ['category']]
        tags:
             - { name: layout.block_type, alias: category }

    oro_catalog.layout.data_provider.category:
        class: 'Oro\Bundle\CatalogBundle\Layout\DataProvider\CategoryProvider'
        public: true
        arguments:
            - '@oro_catalog.handler.request_product'
            - '@doctrine'
            - '@oro_catalog.provider.category_tree_provider'
            - '@oro_security.token_accessor'
            - '@oro_catalog.provider.master_catalog_root'
        tags:
            - { name: layout.data_provider, alias: category }

    oro_catalog.layout.data_provider.category.cache:
        parent: oro.data.cache
        public: false
        tags:
            - { name: 'cache.pool', namespace: 'oro_catalog_category' }

    oro_catalog.layout.data_provider.category_breadcrumb:
        class: 'Oro\Bundle\CatalogBundle\Layout\DataProvider\CategoryBreadcrumbProvider'
        public: true
        arguments:
            - "@oro_catalog.layout.data_provider.category"
            - '@oro_locale.helper.localization'
            - '@router'
            - '@request_stack'
        tags:
            - { name: layout.data_provider, alias: category_breadcrumbs }

    oro_catalog.layout.data_provider.featured_categories:
        class: 'Oro\Bundle\CatalogBundle\Layout\DataProvider\FeaturedCategoriesProvider'
        public: true
        arguments:
            - "@oro_catalog.provider.category_tree_provider"
            - "@oro_security.token_accessor"
            - '@oro_locale.helper.localization'
            - '@oro_website.manager'
        calls:
            - [setCache, ['@oro_catalog.layout.data_provider.category.cache', 3600]]
        tags:
            - { name: layout.data_provider, alias: featured_categories }

    oro_catalog.layout.data_provider.featured_categories_products:
        class: 'Oro\Bundle\CatalogBundle\Layout\DataProvider\CategoriesProductsProvider'
        public: true
        arguments:
            - "@doctrine"
            - "@oro_catalog.website_search.repository.product"
        calls:
            - [setCache, ['@oro_catalog.layout.data_provider.category.cache', 3600]]
        tags:
            - { name: layout.data_provider, alias: categories_products }

    oro_catalog.layout.data_provider.category_filtered_image:
        parent: oro_layout.layout.data_provider.filtered_image.abstract
        public: true
        arguments:
            - '@oro_attachment.manager'
            - '@oro_catalog.provider.category_image_placeholder'
        tags:
            - { name: layout.data_provider, alias: category_filtered_image }

    oro_catalog.layout_context_configurator.product_categories:
        class: Oro\Bundle\CatalogBundle\Layout\Extension\ProductCategoriesContextConfigurator
        arguments:
            - '@request_stack'
            - '@doctrine'
            - '@oro_catalog.layout.data_provider.category'
        tags:
            - { name: layout.context_configurator }

    oro_catalog.layout.data_provider.canonical_url.category:
        class: Oro\Bundle\CatalogBundle\Layout\DataProvider\CategoryCanonicalUrlDataProvider
        arguments:
            - '@oro_config.manager'
            - '@oro_website.resolver.website_system_url_resolver'
            - '@oro_web_catalog.content_node_provider'
            - '@oro_redirect.generator.canonical_url'
            - '@oro_catalog.provider.routing_information_provider'
        tags:
            - { name: layout.data_provider, alias: category_canonical_url }
            - { name: oro_featuretogle.feature, feature: web_catalog_based_canonical_urls }
