parameters:
    oro_segment.segment.entity.class:                        Oro\Bundle\SegmentBundle\Entity\Segment
    oro_segment.segment_manager.class:                       Oro\Bundle\SegmentBundle\Entity\Manager\SegmentManager
    oro_segment.static_segment_manager.class:                Oro\Bundle\SegmentBundle\Entity\Manager\StaticSegmentManager
    oro_segment.segment_manager.api.class:                   Oro\Bundle\SoapBundle\Entity\Manager\ApiEntityManager
    oro_segment.datagrid.configuration.provider.class:       Oro\Bundle\SegmentBundle\Grid\ConfigurationProvider
    oro_segment.filter.segment.class:                        Oro\Bundle\SegmentBundle\Filter\SegmentFilter
    oro_segment.query.dynamic_segment.query_builder.class:   Oro\Bundle\SegmentBundle\Query\DynamicSegmentQueryBuilder
    oro_segment.query.static_segment.query_builder.class:    Oro\Bundle\SegmentBundle\Query\StaticSegmentQueryBuilder
    oro_segment.event_listener.doctrine_pre_remove.class:    Oro\Bundle\SegmentBundle\EventListener\DoctrinePreRemoveListener
    oro_segment.entity_name_provider.class:                  Oro\Bundle\SegmentBundle\Provider\EntityNameProvider
    oro_segment.grid.datagrid_configuration_builder.class:   Oro\Bundle\SegmentBundle\Grid\SegmentDatagridConfigurationBuilder

services:
    oro_segment.entity_provider:
        alias: oro_entity.entity_provider

    oro_segment.static_segment_manager:
        class: %oro_segment.static_segment_manager.class%
        arguments:
            - @doctrine.orm.entity_manager
            - @oro_segment.query.dynamic_segment.query_builder

    oro_segment.segment_manager:
        class: %oro_segment.segment_manager.class%
        arguments:
            - @doctrine.orm.entity_manager

    oro_segment.segment_manager.api:
        class: %oro_segment.segment_manager.api.class%
        parent: oro_soap.manager.entity_manager.abstract
        arguments:
            - %oro_segment.segment.entity.class%
            - @doctrine.orm.entity_manager

    oro_segment.datagrid.configuration.provider:
        class: %oro_segment.datagrid.configuration.provider.class%
        arguments:
            - @oro_segment.grid.datagrid_configuration_builder
            - @doctrine
        tags:
            - { name: oro_datagrid.configuration.provider, priority: 10 }

    oro_segment.filter.segment:
        class: %oro_segment.filter.segment.class%
        arguments:
            - @form.factory
            - @oro_filter.filter_utility
            - @oro_segment.query.dynamic_segment.query_builder.link
            - @oro_segment.query.static_segment.query_builder.link
            - @oro_segment.entity_name_provider
            - @oro_entity_config.provider.entity
            - @oro_entity_config.provider.extend
        tags:
            - { name: oro_filter.extension.orm_filter.filter, type: segment }

    oro_segment.query.dynamic_segment.query_builder.link:
        tags:
            - { name: oro_service_link,  service: oro_segment.query.dynamic_segment.query_builder }

    oro_segment.query.static_segment.query_builder.link:
        tags:
            - { name: oro_service_link,  service: oro_segment.query.static_segment.query_builder }

    oro_segment.query.dynamic_segment.query_builder:
        class: %oro_segment.query.dynamic_segment.query_builder.class%
        arguments:
            - @oro_query_designer.query_designer.restriction_builder
            - @oro_query_designer.query_designer.manager
            - @oro_query_designer.virtual_field_provider
            - @doctrine

    oro_segment.query.static_segment.query_builder:
        class: %oro_segment.query.static_segment.query_builder.class%
        arguments:
            - @doctrine.orm.entity_manager

    oro_segment.event_listener.doctrine_pre_remove:
        class: %oro_segment.event_listener.doctrine_pre_remove.class%
        arguments:
            - @oro_entity_config.config_manager
        tags:
            - { name: doctrine.event_listener, event: preRemove }
            - { name: doctrine.event_listener, event: postFlush }

    oro_segment.entity_name_provider:
        class: %oro_segment.entity_name_provider.class%

    oro_segment.grid.datagrid_configuration_builder:
        class: %oro_segment.grid.datagrid_configuration_builder.class%
        parent: oro_report.grid.base_configuration_builder
