parameters:
    oro_website.entity.website.class: Oro\Bundle\WebsiteBundle\Entity\Website

services:
    oro_website.manager:
        class: 'Oro\Bundle\WebsiteBundle\Manager\WebsiteManager'
        public: true
        arguments:
            - "@doctrine"
            - "@oro_frontend.request.frontend_helper"

    oro_website.twig.website_extension:
        class: 'Oro\Bundle\WebsiteBundle\Twig\OroWebsiteExtension'
        public: false
        arguments:
            - "@oro_website.manager"
        tags:
            - { name: twig.extension }

    oro_website.website.manager.api:
        class: 'Oro\Bundle\SoapBundle\Entity\Manager\ApiEntityManager'
        parent: oro_soap.manager.entity_manager.abstract
        arguments:
            - '%oro_website.entity.website.class%'
            - "@doctrine.orm.entity_manager"

    oro_website.website.provider:
        class: 'Oro\Bundle\WebsiteBundle\Provider\WebsiteProvider'
        arguments:
            - "@doctrine"

    oro_website.model.action.assign_current_website:
        class: 'Oro\Bundle\WebsiteBundle\Model\Action\AssignCurrentWebsite'
        public: false
        arguments:
            - '@oro_action.context_accessor'
            - '@oro_website.manager'
        tags:
            - { name: oro_action.action, alias: assign_current_website }
            - { name: oro_workflow.action, alias: assign_current_website }

    oro_website.translation.strategy.composite_fallback_strategy:
        class: 'Oro\Bundle\WebsiteBundle\Translation\Strategy\CompositeFallbackStrategy'
        public: false
        arguments:
            - '@oro_frontend.request.frontend_helper'
            - '@oro_locale.translation.strategy.localization_fallback_strategy'
            - '@oro_translation.strategy.default'

    oro_website.translation.cache_warmer.composite:
        class: 'Oro\Bundle\WebsiteBundle\Translation\CacheWarmer\CompositeTranslationCacheWarmer'
        public: false
        decorates: 'translation.warmer'
        decoration_inner_name: 'translation.warmer.default'
        arguments:
            - '@translation.warmer.default'
            - '@oro_translation.strategy.provider'
            - '@oro_locale.translation.strategy.localization_fallback_strategy'

    oro_website.event_listener.routing:
        class: 'Oro\Bundle\WebsiteBundle\EventListener\RoutingListener'
        arguments:
            - '@oro_website.manager'
        tags:
            - { name: kernel.event_listener, event: kernel.request, method: onRequest, priority: -50 }

    oro_website.event_listener.install_command:
        class: 'Oro\Bundle\WebsiteBundle\EventListener\InstallCommandListener'
        arguments:
            - '@oro_config.global'
        tags:
            - { name: kernel.event_listener, event: console.terminate, method: onTerminate }

    oro_website.resolver.website_url_resolver:
        class: 'Oro\Bundle\WebsiteBundle\Resolver\WebsiteUrlResolver'
        arguments:
            - '@oro_config.manager'
            - '@router'

    oro_website.twig.website_path:
        class: Oro\Bundle\WebsiteBundle\Twig\WebsitePathExtension
        public: false
        arguments:
            - '@oro_website.resolver.website_url_resolver'
        tags:
            - { name: twig.extension }
