services:
    
    # custom fosuser registration form handler
    nmn_user.form.handler.registration:
        class: Nmn\MultiUserBundle\Form\Handler\RegistrationFormHandler
        arguments: ["@fos_user.registration.form", "@request", "@fos_user.user_manager", "@fos_user.mailer", "@nmn_user.manager.user_discriminator"]
        scope: request
        public: false
    
    # custom fosuser profile form handler
    nmn_user.form.handler.profile:
        class: Nmn\MultiUserBundle\Form\Handler\ProfileFormHandler
        arguments: ["@fos_user.profile.form", "@request", "@fos_user.user_manager", "@nmn_user.manager.user_discriminator"]
        scope: request
        public: false
    
    # class to discriminate users types
    nmn_user.manager.user_discriminator:
        class:     Nmn\MultiUserBundle\Manager\UserDiscriminator
        arguments: ["@service_container", %nmn_user_discriminator_parameters%]
        tags:
            - { name: kernel.event_listener, event: security.interactive_login }
            - { name: kernel.event_listener, event: security.manual_login }
                
    # alias
    nmn_user_registration_form_handler:
        alias: nmn_user.form.handler.registration
    nmn_user_profile_form_handler:
        alias: nmn_user.form.handler.profile
    nmn_user_discriminator:
        alias: nmn_user.manager.user_discriminator
    
    