services:
    Oro\Bundle\CaseBundle\Model\CaseEntityManager:
        alias: oro_case.manager

    oro_case.manager:
        class: Oro\Bundle\CaseBundle\Model\CaseEntityManager
        public: true
        arguments:
            - "@doctrine"
            - "@oro_security.acl_helper"

    oro_case.manager.api:
        class: Oro\Bundle\CaseBundle\Model\CaseApiEntityManager
        public: true
        parent: oro_soap.manager.entity_manager.abstract
        arguments:
            - 'Oro\Bundle\CaseBundle\Entity\CaseEntity'
            - "@doctrine.orm.entity_manager"
            - "@oro_case.manager"

    oro_case.manager.comment.api:
        class: Oro\Bundle\CaseBundle\Model\CommentApiEntityManager
        public: true
        parent: oro_soap.manager.entity_manager.abstract
        arguments:
            - 'Oro\Bundle\CaseBundle\Entity\CaseComment'
            - "@doctrine.orm.entity_manager"
            - "@oro_case.manager"

    Oro\Bundle\CaseBundle\Model\ViewFactory:
        alias: oro_case.view_factory

    oro_case.view_factory:
        class: Oro\Bundle\CaseBundle\Model\ViewFactory
        public: true
        arguments:
            - "@security.authorization_checker"
            - "@router"
            - "@oro_entity.entity_name_resolver"
            - "@oro_locale.formatter.date_time"
            - "@oro_attachment.provider.picture_sources"

    oro_case.provider.phone.case:
        class: Oro\Bundle\CaseBundle\Provider\CasePhoneProvider
        tags:
            - { name: oro_address.phone_provider, class: 'Oro\Bundle\CaseBundle\Entity\CaseEntity' }

    oro_case.provider.mailbox_process.case:
        class: Oro\Bundle\CaseBundle\Provider\CaseMailboxProcessProvider
        tags:
            - { name: oro_email.mailbox_process, type: case }

    oro_case.event_listener.mailbox_saved_listener:
        class: Oro\Bundle\CaseBundle\EventListener\MailboxSavedListener
        arguments:
            - "@oro_tag.tag.manager"
        tags:
            - { name: kernel.event_listener, event: oro_email.mailbox_saved, method: onMailboxSave }

    oro_case.event_listener.search_index_data_listener:
        class: Oro\Bundle\CaseBundle\EventListener\SearchIndexDataListener
        arguments:
            - '@oro_search.mapper'
        calls:
            - [setShortenedFields, [{ 'description' : 255, 'resolution' : 255, 'message' : 255 }]]
        tags:
            - { name: kernel.event_listener, event: oro_search.prepare_entity_map, method: onPrepareEntityMap }
