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

    Claroline\HistoryBundle\Manager\HistoryManager:
        arguments:
            - '@Claroline\AppBundle\Persistence\ObjectManager'
        calls:
            - setLogger: [ '@logger' ]

    Claroline\HistoryBundle\Listener\WorkspaceListener:
        arguments:
            - '@security.token_storage'
            - '@Claroline\AppBundle\Manager\SecurityManager'
            - '@Claroline\HistoryBundle\Manager\HistoryManager'
        tags:
            - { name: kernel.event_listener, event: workspace.open, method: onOpen }

    Claroline\HistoryBundle\Listener\ResourceListener:
        arguments:
            - '@security.token_storage'
            - '@Claroline\AppBundle\Manager\SecurityManager'
            - '@Claroline\HistoryBundle\Manager\HistoryManager'
        tags:
            - { name: kernel.event_listener, event: resource_load, method: onLoad }

    Claroline\HistoryBundle\Controller\HistoryController:
        arguments:
            - '@Claroline\AppBundle\API\SerializerProvider'
            - '@Claroline\HistoryBundle\Manager\HistoryManager'

    # Console commands

    Claroline\HistoryBundle\Command\CleanHistoryCommand:
        arguments:
            - '@Claroline\HistoryBundle\Manager\HistoryManager'
        tags:
            - { name: console.command, command: claroline:history:clean }
