services:
    _defaults:
        autowire: false
        autoconfigure: false
        public: true

    UJM\ExoBundle\Listener\Entity\ItemListener:
        arguments:
            - '@UJM\ExoBundle\Library\Item\ItemDefinitionsCollection'
        tags:
            - { name: 'doctrine.orm.entity_listener', entity: 'UJM\ExoBundle\Entity\Item\Item', event: 'postLoad' }
            - { name: 'doctrine.orm.entity_listener', entity: 'UJM\ExoBundle\Entity\Item\Item', event: 'prePersist' }
            - { name: 'doctrine.orm.entity_listener', entity: 'UJM\ExoBundle\Entity\Item\Item', event: 'preRemove' }

    UJM\ExoBundle\Listener\Log\DisplayLogListener:
        arguments:
            - '@service_container'
        tags:
            - { name: kernel.event_listener, event: create_log_details_resource-ujm_exercise-exercise_evaluated, method: onCreateLogDetails }

    UJM\ExoBundle\Listener\Resource\ExerciseListener:
        arguments:
            - '@security.authorization_checker'
            - '@UJM\ExoBundle\Manager\ExerciseManager'
            - '@UJM\ExoBundle\Manager\Attempt\PaperManager'
            - '@UJM\ExoBundle\Manager\AttemptManager'
            - '@Claroline\AppBundle\Persistence\ObjectManager'
            - '@Claroline\EvaluationBundle\Manager\ResourceEvaluationManager'
            - '@security.token_storage'
            - '@Claroline\AppBundle\API\SerializerProvider'
        tags:
            - { name: kernel.event_listener, event: resource.ujm_exercise.load, method: onLoad }
            - { name: kernel.event_listener, event: resource.ujm_exercise.delete, method: onDelete }

    UJM\ExoBundle\Listener\Tool\QuestionBankListener:
        tags:
            - { name: kernel.event_listener, event: tool.open.desktop.ujm_questions, method: onDisplayDesktop }
