parameters:
#    d2_core.example.class: D2\CoreBundle\Example

services:
    entity_id.type:
        class: D2\CoreBundle\Form\Type\EntityIdType
        arguments: [@doctrine]
        tags:
            - { name: form.type, alias: entity_id }

    d2_config_manager:
        class:          D2\CoreBundle\DependencyInjection\Services\ConfigManager
        arguments:      [@doctrine]

    d2_crypto_manager:
        class:          D2\CoreBundle\DependencyInjection\Services\CryptoManager
        arguments:      []

    d2_system_spout_service:
        class: D2\CoreBundle\DependencyInjection\Services\SpoutService
        arguments:      [@service_container, @doctrine.orm.entity_manager]

    d2_core.menu_builder:
        class: D2\CoreBundle\Menu\MenuBuilder
        arguments: ["@knp_menu.factory", "@security.context"]

    d2_core.menu.main_top:
        class: Knp\Menu\MenuItem # the service definition requires setting the class
        factory_service: d2_core.menu_builder
        factory_method: createMainMenu
        arguments: ["@request"]
        scope: request # needed as we have the request as a dependency here
        tags:
            - { name: knp_menu.menu, alias: main_top } # The alias is what is used to retrieve the menu

    mopa_bootstrap.example.navbar:
        class: %mopa_bootstrap.navbar.generic%
        scope: request
        arguments:
            # first argument: a named array of menues:
            - { leftmenu: @d2_core.menu.main_top }
            # second argument: a named array of FormType Classes  
            - { }
            # third argument: a named array of options
            - { title: "Move Analytics", titleRoute: "home_page", fixedTop: false, isFluid: true }
        tags:
            # The alias is used to retrieve the navbar in templates
            - { name: mopa_bootstrap.navbar, alias: frontendNavbar }

    d2_system_notification_manager:
        class:          D2\CoreBundle\DependencyInjection\Services\SystemNotificationManager
        arguments:      [@service_container, @mailer, @templating, @doctrine.orm.entity_manager]

    d2_simple_xls_import_manager:
        class:          D2\CoreBundle\DependencyInjection\Services\SimpleXLSManager
        arguments:      [@service_container, @doctrine.orm.entity_manager]

    d2_xls_import_manager:
        class:          D2\CoreBundle\DependencyInjection\Services\XLSManager
        arguments:      [@service_container, @doctrine.orm.entity_manager]

    d2_with_selected:
        class:          D2\CoreBundle\DependencyInjection\Services\WithSelectedManager
        arguments:      [@service_container, @twig, @session]
    
    d2_query_helper:
        class:          D2\CoreBundle\DependencyInjection\Services\QueryHelper

    # event listeners
    kernel.listener.ajax_exception_listener:
        class: D2\CoreBundle\DependencyInjection\EventListeners\AjaxExceptionListener
        tags:
            - { name: kernel.event_listener, event: kernel.exception, method: onCoreException, priority: 1000 }

 
    kernel.listener.pdf_response_listener:
        class: D2\CoreBundle\DependencyInjection\EventListeners\PDFResponseListener
        arguments: [@knp_snappy.pdf]
        tags:
            - { name: kernel.event_listener, event: kernel.response, method: onKernelResponse }
            
 
    kernel.listener.core_request_listener:
        class: D2\CoreBundle\DependencyInjection\EventListeners\CoreRequestListener
        arguments: [@service_container]
        tags:
            - { name: kernel.event_listener, event: kernel.request, method: onKernelRequest }

    d2.corebundle.event_listeners.request:
        class: D2\CoreBundle\RequestListener
        tags:
            - { name: kernel.event_listener, event: kernel.request, method: onKernelRequest } 

    # twig extensions
    d2_core_bundle.twig.with_selected_extension:
        class:          D2\CoreBundle\Twig\WithSelectedTwigExtension
        arguments:      [@service_container]
        tags:
            - { name: twig.extension }

    d2_core_bundle.twig.config_extension:
        class:          D2\CoreBundle\Twig\ConfigTwigExtension
        arguments:      [@d2_config_manager]
        tags:
            - { name: twig.extension }

    d2_core_bundle.twig.general_extension:
        class:          D2\CoreBundle\Twig\GeneralTwigExtension
        arguments:      []
        tags:
            - { name: twig.extension }

    d2_core_bundle.twig.csv_extension:
        class:          D2\CoreBundle\Twig\CSVExtension
        tags:
            - { name: twig.extension }
            
