parameters:
    ezdemo.criteria_helper.class: EzSystems\DemoBundle\Helper\CriteriaHelper
    ezdemo.menu_helper.class: EzSystems\DemoBundle\Helper\MenuHelper
    ezdemo.place_helper.class: EzSystems\DemoBundle\Helper\PlaceHelper
    ezdemo.search_helper.class: EzSystems\DemoBundle\Helper\SearchHelper
    ezdemo.email_helper.class: EzSystems\DemoBundle\Helper\EmailHelper
    ezdemo.form.type.feedback.class: EzSystems\DemoBundle\Form\Type\FeedbackType
    ezdemo.form.type.simple_search.class: EzSystems\DemoBundle\Form\Type\SimpleSearchType

    # Default limit that will be applied when retrieving content for menus.
    ezdemo.menu_helper.default_limit: 10

services:
    ezdemo.criteria_helper:
        class: %ezdemo.criteria_helper.class%

    ezdemo.menu_helper:
        class: %ezdemo.menu_helper.class%
        arguments: [@ezpublish.api.repository, %ezdemo.menu_helper.default_limit%, @ezdemo.search_helper]

    ezdemo.place_helper:
            class: %ezdemo.place_helper.class%
            arguments:
                - @ezpublish.api.service.location
                - @ezpublish.api.service.search
                - @ezdemo.search_helper
                - %ezdemo.places.place_list.min%
                - %ezdemo.places.place_list.max%

    ezdemo.email_helper:
        class: %ezdemo.email_helper.class%
        arguments:
            - @translator
            - @templating
            - @mailer

    ezdemo.search_helper:
        class: %ezdemo.search_helper.class%
        arguments:
            - @ezpublish.api.service.search
            - %ezdemo.search.list.limit%

    # Declaring the feedback form as a service
    ezdemo.form.type.feedback:
        class: %ezdemo.form.type.feedback.class%
        tags:
            - { name: form.type, alias: ezdemo_feedback }

    ezdemo.form.type.simple_search:
        class: %ezdemo.form.type.simple_search.class%
        tags:
            - { name: form.type, alias: ezdemo_simple_search }

    ezdemo.menu.builder:
        class: EzSystems\DemoBundle\Menu\Builder
        arguments:
            - @knp_menu.factory
            - @ezpublish.api.service.search
            - @router
            - @ezpublish.config.resolver
            - @ezpublish.api.service.location
            - @ezpublish.translation_helper

    ezdemo.menu.top:
        class: EzSystems\DemoBundle\Menu\Builder
        factory_service: ezdemo.menu.builder
        factory_method: createTopMenu
        arguments: [ @request ]
        scope: request # needed as we have the request as a dependency here
        tags:
            - { name: knp_menu.menu, alias: top } # The alias is what is used to retrieve the menu
