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

    Icap\BlogBundle\Listener\DataSource\BlogPostsSource:
        arguments:
            - '@security.token_storage'
            - '@Claroline\AppBundle\API\FinderProvider'
        tags:
            - { name: kernel.event_listener, event: data_source.blog_posts.load, method: getData }

    Icap\BlogBundle\Listener\LogListener:
        calls:
            - [setContainer, ["@service_container"]]
        tags:
            - { name: kernel.event_listener, event: create_log_details_resource-icap_blog-configure,          method: onPostCreateLogDetails }
            - { name: kernel.event_listener, event: create_log_details_resource-icap_blog-configure_banner,   method: onPostCreateLogDetails }
            - { name: kernel.event_listener, event: create_log_details_resource-icap_blog-post_create,        method: onPostCreateLogDetails }
            - { name: kernel.event_listener, event: create_log_details_resource-icap_blog-post_read,          method: onPostCreateLogDetails }
            - { name: kernel.event_listener, event: create_log_details_resource-icap_blog-post_update,        method: onPostCreateLogDetails }
            - { name: kernel.event_listener, event: create_log_details_resource-icap_blog-post_delete,        method: onPostCreateLogDetails }
            - { name: kernel.event_listener, event: create_log_details_resource-icap_blog-post_publish,       method: onPostCreateLogDetails }
            - { name: kernel.event_listener, event: create_log_details_resource-icap_blog-comment_create,     method: onPostCreateLogDetails }
            - { name: kernel.event_listener, event: create_log_details_resource-icap_blog-comment_delete,     method: onPostCreateLogDetails }
            - { name: kernel.event_listener, event: create_log_details_resource-icap_blog-comment_update,     method: onPostCreateLogDetails }
            - { name: kernel.event_listener, event: create_log_details_resource-icap_blog-comment_publish,    method: onPostCreateLogDetails }

            - { name: kernel.event_listener, event: create_log_list_item_resource-icap_blog-configure,        method: onCreateLogListItem }
            - { name: kernel.event_listener, event: create_log_list_item_resource-icap_blog-configure_banner, method: onCreateLogListItem }
            - { name: kernel.event_listener, event: create_log_list_item_resource-icap_blog-post_create,      method: onCreateLogListItem }
            - { name: kernel.event_listener, event: create_log_list_item_resource-icap_blog-post_read,        method: onCreateLogListItem }
            - { name: kernel.event_listener, event: create_log_list_item_resource-icap_blog-post_update,      method: onCreateLogListItem }
            - { name: kernel.event_listener, event: create_log_list_item_resource-icap_blog-post_publish,     method: onCreateLogListItem }
            - { name: kernel.event_listener, event: create_log_list_item_resource-icap_blog-post_delete,      method: onCreateLogListItem }
            - { name: kernel.event_listener, event: create_log_list_item_resource-icap_blog-comment_create,   method: onCreateLogListItem }
            - { name: kernel.event_listener, event: create_log_list_item_resource-icap_blog-comment_delete,   method: onCreateLogListItem }
            - { name: kernel.event_listener, event: create_log_list_item_resource-icap_blog-comment_update,   method: onCreateLogListItem }
            - { name: kernel.event_listener, event: create_log_list_item_resource-icap_blog-comment_publish,  method: onCreateLogListItem }

    Icap\BlogBundle\Listener\Resource\BlogListener:
        arguments:
            - '@security.authorization_checker'
            - '@security.token_storage'
            - '@Claroline\AppBundle\Persistence\ObjectManager'
            - '@Claroline\AppBundle\API\SerializerProvider'
            - '@Icap\BlogBundle\Manager\BlogManager'
            - '@Icap\BlogBundle\Manager\PostManager'
            - '@Icap\BlogBundle\Manager\CommentManager'
        tags:
            - { name: kernel.event_listener, event: resource.icap_blog.load, method: onLoad }
            - { name: kernel.event_listener, event: resource.icap_blog.export, method: onExport }
            - { name: kernel.event_listener, event: resource.icap_blog.import, method: onImport }
            - { name: kernel.event_listener, event: resource.icap_blog.copy, method: onCopy }

    Icap\BlogBundle\Listener\NotificationListener:
        arguments:
            - '@translator'
            - '@router'
        tags:
            - { name: kernel.event_listener, event: create_notification_item_resource-icap_blog-post_create, method: onCreateNotificationItem }
            - { name: kernel.event_listener, event: create_notification_item_resource-icap_blog-post_update, method: onCreateNotificationItem }
            - { name: kernel.event_listener, event: create_notification_item_resource-icap_blog-post_publish, method: onCreateNotificationItem }
            - { name: kernel.event_listener, event: create_notification_item_resource-icap_blog-comment_create, method: onCreateNotificationItem }
            - { name: kernel.event_listener, event: create_notification_item_resource-icap_blog-comment_update, method: onCreateNotificationItem }
            - { name: kernel.event_listener, event: create_notification_item_resource-icap_blog-comment_publish, method: onCreateNotificationItem }
            - { name: kernel.event_listener, event: create_notification_item_resource-icap_blog-post-user_tagged, method: onCreateNotificationItem }
            - { name: kernel.event_listener, event: create_notification_item_resource-icap_blog-comment-user_tagged, method: onCreateNotificationItem }

    Icap\BlogBundle\Listener\NotificationUserParametersListener:
        tags:
            - { name: kernel.event_listener, event: icap_notification_user_parameters_event, method: onGetTypesForParameters }

    Icap\BlogBundle\Listener\CommentListener:
        arguments:
            - '@Icap\NotificationBundle\Manager\NotificationManager'
        tags:
            - { name: 'doctrine.orm.entity_listener', entity: 'Icap\BlogBundle\Entity\Comment', event: 'prePersist' }
            - { name: 'doctrine.orm.entity_listener', entity: 'Icap\BlogBundle\Entity\Comment', event: 'postPersist' }
            - { name: 'doctrine.orm.entity_listener', entity: 'Icap\BlogBundle\Entity\Comment', event: 'preUpdate' }
            - { name: 'doctrine.orm.entity_listener', entity: 'Icap\BlogBundle\Entity\Comment', event: 'postUpdate' }

    Icap\BlogBundle\Listener\PostListener:
        arguments:
            - '@Icap\NotificationBundle\Manager\NotificationManager'
        tags:
            - { name: 'doctrine.orm.entity_listener', entity: 'Icap\BlogBundle\Entity\Post', event: 'prePersist' }
            - { name: 'doctrine.orm.entity_listener', entity: 'Icap\BlogBundle\Entity\Post', event: 'postPersist' }
            - { name: 'doctrine.orm.entity_listener', entity: 'Icap\BlogBundle\Entity\Post', event: 'preUpdate' }
            - { name: 'doctrine.orm.entity_listener', entity: 'Icap\BlogBundle\Entity\Post', event: 'postUpdate' }
