parameters:
    oro_entity_extend.migration.config_processor.options.path: '%kernel.cache_dir%/oro_migration/extend_config_options.bin'
    oro_entity_extend.migration.initial_entity_config_state.path: '%kernel.cache_dir%/oro_migration/initial_entity_config_state.bin'

services:
    # the metadata factory for default entity manager
    # it is declared as a service to allow make it as the persistent service for MQ consumer
    # see Oro/Bundle/EntityExtendBundle/Resources/config/oro/app.yml
    # and Oro\Bundle\EntityExtendBundle\DependencyInjection\Compiler\EntityManagerPass
    oro_entity_extend.orm.metadata_factory:
        class: Oro\Bundle\EntityExtendBundle\Mapping\ExtendClassMetadataFactory
        calls:
            - [ 'setMappingDriver', [ '@doctrine.orm.entity_manager', '@oro_entity_extend.orm.mapping_driver' ] ]

    oro_entity_extend.orm.mapping_driver:
        class: Oro\Bundle\EntityExtendBundle\Tools\YamlDriver
        lazy: true
        arguments:
            - "@oro_entity_config.config_manager"

    oro_entity_extend.orm.metadata_reflection_service:
        class: Oro\Bundle\EntityExtendBundle\Doctrine\Persistence\Mapping\VirtualPropertyRuntimeReflectionService

    oro_entity_extend.entity_field_iterator:
        public: true
        class: Oro\Bundle\EntityExtendBundle\EntityExtend\EntityFieldIterator
        arguments:
            - !tagged_iterator { tag: 'oro_entity_extend.entity_field_extension' }

    oro_entity_extend.entity_metadata_provider:
        public: true
        class: Oro\Bundle\EntityExtendBundle\EntityExtend\ExtendEntityMetadataProvider
        arguments:
            - "@oro_entity_config.config_manager"
            - '@oro_entity.doctrine_helper'

    oro_entity_extend.entity_field.extension:
        class: Oro\Bundle\EntityExtendBundle\EntityExtend\EntityFieldExtension
        tags:
            - { name: 'oro_entity_extend.entity_field_extension', priority: 110 }

    oro_entity_extend.entity.cache.warmer:
        public: true
        class: Oro\Bundle\EntityExtendBundle\Cache\EntityCacheWarmer
        arguments:
            - "@oro_entity_extend.tools.dumper"
            - "@oro_entity_config.config_manager"
            - "@oro_entity_config.config_cache_warmer"
        tags:
            - { name: kernel.cache_warmer, priority: 30 }

    oro_entity_extend.datagrid.extension.fields_helper:
        class: Oro\Bundle\EntityExtendBundle\Grid\FieldsHelper
        arguments:
            - "@oro_entity_config.config_manager"
            - "@oro_featuretoggle.checker.feature_checker"

    oro_entity_extend.datagrid.extension.additional_fields:
        class: Oro\Bundle\EntityExtendBundle\Grid\AdditionalFieldsExtension
        arguments:
            - "@oro_entity_config.config_manager"
            - "@oro_entity.orm.entity_class_resolver"
            - "@oro_datagrid.datagrid.guesser"
            - "@oro_entity_extend.datagrid.extension.fields_helper"
        tags:
            - { name: oro_datagrid.extension }

    oro_entity_extend.datagrid.extension.dynamic_fields:
        class: Oro\Bundle\EntityExtendBundle\Grid\DynamicFieldsExtension
        arguments:
            - "@oro_entity_config.config_manager"
            - "@oro_entity.orm.entity_class_resolver"
            - "@oro_datagrid.datagrid.guesser"
            - "@oro_entity_extend.datagrid.extension.fields_helper"
            - "@oro_entity.doctrine_helper"
            - "@oro_datagrid.provider.selected_fields"
        tags:
            - { name: oro_datagrid.extension }

    oro_entity_extend.form.extension.dynamic_fields_helper:
        class: Oro\Bundle\EntityExtendBundle\Form\Util\DynamicFieldsHelper
        public: false
        arguments:
            - '@oro_entity_config.config_manager'
            - '@oro_featuretoggle.checker.feature_checker'
            - '@oro_entity.doctrine_helper'
            - "@router"
            - "@translator"

    oro_entity_extend.form_extension.dynamic_fields_options_extension:
        class: Oro\Bundle\EntityExtendBundle\Form\Extension\DynamicFieldsOptionsExtension
        tags:
            - { name: form.type_extension }

    oro_entity_extend.form.extension.dynamic_fields:
        class: Oro\Bundle\EntityExtendBundle\Form\Extension\DynamicFieldsExtension
        arguments:
            - "@oro_entity_config.config_manager"
            - "@oro_entity.doctrine_helper"
            - '@logger'
            - '@translator'
            - '@Psr\Container\ContainerInterface'
            - '%kernel.debug%'
        tags:
            - { name: form.type_extension }
            - { name: container.service_subscriber, id: oro_entity_extend.form.extension.dynamic_fields_helper }

    oro_entity_extend.entity_generator:
        class: Oro\Bundle\EntityExtendBundle\Tools\EntityGenerator
        arguments:
            - '%kernel.cache_dir%'
            - !tagged_iterator oro_entity_extend.entity_generator_extension

    oro_entity_extend.entity_generator.extension:
        class: Oro\Bundle\EntityExtendBundle\Tools\GeneratorExtensions\ExtendEntityGeneratorExtension
        arguments:
            - '@Doctrine\Inflector\Inflector'
        tags:
            - { name: oro_entity_extend.entity_generator_extension, priority: 255 }

    oro_entity_extend.tools.dumper:
        class: Oro\Bundle\EntityExtendBundle\Tools\ExtendConfigDumper
        arguments:
            - "@oro_entity_config.entity_manager_bag"
            - "@oro_entity_config.config_manager"
            - "@oro_entity_extend.db_id_name_generator"
            - "@oro_entity_extend.extend.field_type_helper"
            - "@oro_entity_extend.entity_generator"
            - "@oro_entity_config.provider.extend_entity_config_provider"
            - '%kernel.cache_dir%'
            - !tagged_iterator oro_entity_extend.entity_config_dumper_extension

    oro_entity_extend.entity_config_dumper.extension.association:
        abstract: true
        arguments:
            - "@oro_entity_config.config_manager"
            - "@oro_entity_extend.association_builder"

    oro_entity_extend.entity_config_dumper.extension.index:
        class: Oro\Bundle\EntityExtendBundle\Tools\DumperExtensions\IndexEntityConfigDumperExtension
        arguments:
            - "@oro_entity_config.config_manager"
            - "@oro_entity_extend.extend.field_type_helper"
        tags:
            - { name: oro_entity_extend.entity_config_dumper_extension, priority: -255 }

    oro_entity_extend.entity_config_dumper.extension.relation:
        class: Oro\Bundle\EntityExtendBundle\Tools\DumperExtensions\RelationEntityConfigDumperExtension
        arguments:
            - "@oro_entity_config.config_manager"
            - "@oro_entity_extend.extend.field_type_helper"
        tags:
            - { name: oro_entity_extend.entity_config_dumper_extension, priority: 255 }

    oro_entity_extend.entity_config_dumper.extension.enum:
        class: Oro\Bundle\EntityExtendBundle\Tools\DumperExtensions\EnumEntityConfigDumperExtension
        arguments:
            - "@oro_entity_config.config_manager"
            - "@oro_entity_extend.relation_builder"
            - "@oro_entity_extend.extend.field_type_helper"
            - "@oro_entity_extend.db_id_name_generator"
            - "@oro_entity_config.provider.extend_entity_config_provider"
        tags:
            - { name: oro_entity_extend.entity_config_dumper_extension }

    oro_entity_extend.listener.config_listener:
        class: Oro\Bundle\EntityExtendBundle\EventListener\EntityConfigListener
        arguments:
            - '@event_dispatcher'
        tags:
            - { name: kernel.event_listener, event: oro.entity_config.entity.create, method: updateEntity }
            - { name: kernel.event_listener, event: oro.entity_config.entity.update, method: updateEntity }
            - { name: kernel.event_listener, event: oro.entity_config.field.create, method: createField }
            - { name: kernel.event_listener, event: oro.entity_config.field.rename, method: renameField }
            - { name: kernel.event_listener, event: oro.entity_config.pre_flush, method: preFlush }

    oro_entity_extend.db_id_name_generator:
        alias: oro_migration.db_id_name_generator
        public: true

    oro_entity_extend.validator.not_sql_keyword:
        class: Oro\Bundle\EntityExtendBundle\Validator\Constraints\NotSqlKeywordValidator
        arguments:
            - "@doctrine"
        tags:
            - { name: validator.constraint_validator, alias: oro_entity_extend.validator.not_sql_keyword }

    oro_entity_extend.validator.unique_keys:
        class: Oro\Bundle\EntityExtendBundle\Validator\Constraints\UniqueKeysValidator
        tags:
            - { name: validator.constraint_validator, alias: oro_entity_extend.validator.unique_keys }

    oro_entity_extend.validator.unique_extend_entity_field_validator:
        class: Oro\Bundle\EntityExtendBundle\Validator\Constraints\UniqueExtendEntityFieldValidator
        arguments:
            - "@oro_entity_extend.extend.field_name_validation_helper"
        tags:
            - { name: validator.constraint_validator, alias: oro_entity_extend.validator.unique_extend_entity_field }

    oro_entity_extend.validator.change_type_extend_entity_field_validator:
        class: Oro\Bundle\EntityExtendBundle\Validator\Constraints\ChangeTypeExtendEntityFieldValidator
        arguments:
            - "@oro_entity_extend.extend.field_name_validation_helper"
        tags:
            - { name: validator.constraint_validator, alias: oro_entity_extend.validator.change_type_extend_entity_field }

    oro_entity_extend.validator.unique_extend_entity_method_name_validator:
        class: Oro\Bundle\EntityExtendBundle\Validator\Constraints\UniqueExtendEntityMethodNameValidator
        arguments:
            - '@oro_entity_extend.extend.field_name_validation_helper'
            - '@oro_entity_extend.tools.class_method_name_checker'
            - '@oro_entity_extend.extend.field_type_helper'
        tags:
            - { name: validator.constraint_validator }

    oro_entity_extend.validator.default_relation_field:
        class: Oro\Bundle\EntityExtendBundle\Validator\Constraints\DefaultRelationFieldValidator
        arguments:
            - "@oro_entity_extend.extend.field_name_validation_helper"
        tags:
            - { name: validator.constraint_validator, alias: oro_entity_extend.validator.default_relation_field }

    oro_entity_extend.validator.multi_enum_snapshot:
        class: Oro\Bundle\EntityExtendBundle\Validator\Constraints\MultiEnumSnapshotFieldValidator
        arguments:
            - "@oro_entity_extend.extend.field_name_validation_helper"
        tags:
            - { name: validator.constraint_validator, alias: oro_entity_extend.validator.multi_enum_snapshot }

    oro_entity_extend.validator.unique_enum_name:
        class: Oro\Bundle\EntityExtendBundle\Validator\Constraints\UniqueEnumNameValidator
        arguments:
            - "@oro_entity_config.config_manager"
        tags:
            - { name: validator.constraint_validator, alias: oro_entity_extend.validator.unique_enum_name }

    oro_entity_extend.validator.unique_enum_values:
        class: Oro\Bundle\EntityExtendBundle\Validator\Constraints\EnumValuesUniqueValidator
        tags:
            - { name: validator.constraint_validator, alias: oro_entity_extend.validator.unique_enum_values }

    oro_entity_extend.validator.non_extended_entity_bidirectional:
        class: Oro\Bundle\EntityExtendBundle\Validator\Constraints\NonExtendedEntityBidirectionalValidator
        arguments:
            - "@oro_entity_config.config_manager"
        tags:
            - { name: validator.constraint_validator, alias: oro_entity_extend.validator.non_extended_entity_bidirectional }

    oro_entity_extend.validator.attribute_configuration:
        class: Oro\Bundle\EntityExtendBundle\Validator\Constraints\AttributeConfigurationValidator
        arguments:
            - '@oro_entity_config.registry.attribute_type'
            - '@oro_entity_config.provider.attribute'
            - '@oro_entity_config.config_manager'
        tags:
            - { name: validator.constraint_validator, alias: oro_entity_extend.validator.attribute_configuration }

    oro_entity_extend.migration.config_processor:
        class: Oro\Bundle\EntityExtendBundle\Migration\ExtendConfigProcessor
        arguments:
            - "@oro_entity_config.config_manager"

    oro_entity_extend.extend.update_handler:
        class: Oro\Bundle\EntityExtendBundle\Extend\EntityExtendUpdateHandler
        arguments:
            - '@oro_entity_extend.extend.update_processor'

    oro_entity_extend.extend.update_processor:
        class: Oro\Bundle\EntityExtendBundle\Extend\EntityExtendUpdateProcessor
        arguments:
            - '@oro_maintenance.maintenance'
            - '@oro_entity_config.tools.command_executor'
            - '@logger'
            - '@event_dispatcher'
            - '@oro_entity_config.tools.backup_manager.entity_config_backup_manager'
            - '@oro_entity_config.config_manager'
            - '@?profiler'

    oro_entity_extend.extend.entity_proxy_generator:
        class: Oro\Bundle\EntityExtendBundle\Extend\EntityProxyGenerator
        arguments:
            - "@oro_entity_config.entity_manager_bag"
            - "@oro_entity_config.provider.extend"
            - '%kernel.cache_dir%'

    oro_entity_extend.extend.field_type_helper:
        class: Oro\Bundle\EntityExtendBundle\Extend\FieldTypeHelper
        arguments:
            - '@oro_entity_extend.configuration_provider'

    oro_entity_extend.extend_entity_platform_update_checker:
        class: Oro\Bundle\EntityExtendBundle\Provider\ExtendEntityPlatformUpdateChecker
        arguments:
            - '@oro_entity_config.config_manager'
        tags:
            - { name: oro.installer.platform_update_checker }

    oro_entity_extend.configuration_provider:
        class: Oro\Bundle\EntityExtendBundle\Configuration\EntityExtendConfigurationProvider
        public: false
        parent: oro.static_config_provider.abstract
        arguments:
            - '%kernel.cache_dir%/oro/entity_extend.php'
            - '%kernel.debug%'

    oro_entity_extend.extend.field_name_validation_helper:
        class: Oro\Bundle\EntityExtendBundle\Validator\FieldNameValidationHelper
        arguments:
            - '@oro_entity_config.provider.extend'
            - '@event_dispatcher'
            - '@oro_importexport.strategy.new_entities_helper'
            - '@Doctrine\Inflector\Inflector'

    oro_entity_extend.migration.cleanup_marketing_entity_config.post_up.listener:
        class: Oro\Bundle\EntityExtendBundle\EventListener\CleanupMarketingPostUpMigrationListener
        arguments:
            - '@kernel'
        tags:
            - { name: kernel.event_listener, event: oro_migration.post_up, method: onPostUp, priority: -80 }

    oro_entity_extend.migration.refresh_cache_before_entity_config_update.post_up.listener:
        class: Oro\Bundle\EntityExtendBundle\EventListener\RefreshExtendCachePostUpMigrationListener
        arguments:
            - "@oro_entity_config.tools.command_executor"
            - "@oro_entity_config.config_manager"
            - '%oro_entity_extend.migration.initial_entity_config_state.path%'
        tags:
            - { name: kernel.event_listener, event: oro_migration.pre_up, method: onPreUp, priority: 100 }
            - { name: kernel.event_listener, event: oro_migration.post_up, method: onPostUp, priority: -85 }

    oro_entity_extend.migration.update_config.post_up.listener:
        class: Oro\Bundle\EntityExtendBundle\EventListener\UpdateExtendConfigPostUpMigrationListener
        arguments:
            - "@oro_entity_config.tools.command_executor"
            - '%oro_entity_extend.migration.config_processor.options.path%'
            - '%oro_entity_extend.migration.initial_entity_config_state.path%'
        tags:
            - { name: kernel.event_listener, event: oro_migration.post_up, method: onPostUp, priority: -100 }

    oro_entity_extend.migration.update_indices.post_up.listener:
        class: Oro\Bundle\EntityExtendBundle\EventListener\UpdateExtendIndicesPostUpMigrationListener
        arguments:
            - "@oro_entity_extend.migration.entity_metadata_helper"
            - "@oro_entity_extend.extend.field_type_helper"
        tags:
            - { name: kernel.event_listener, event: oro_migration.post_up, method: onPostUp, priority: -120 }

    oro_entity_extend.migration.entity_metadata_helper:
        class: Oro\Bundle\EntityExtendBundle\Migration\EntityMetadataHelper
        arguments:
            - "@doctrine"

    oro_entity_extend.migration.options_manager:
        class: Oro\Bundle\EntityExtendBundle\Migration\ExtendOptionsManager
        arguments:
            - "@oro_entity_config.configuration_handler"

    oro_entity_extend.migration.options_parser:
        class: Oro\Bundle\EntityExtendBundle\Migration\ExtendOptionsParser
        public: true
        arguments:
            - "@oro_entity_extend.migration.entity_metadata_helper"
            - "@oro_entity_extend.extend.field_type_helper"
            - "@oro_entity_config.config_manager"

    oro_entity_extend.migration.extension.extend:
        class: Oro\Bundle\EntityExtendBundle\Migration\Extension\ExtendExtension
        arguments:
            - "@oro_entity_extend.migration.options_manager"
            - "@oro_entity_extend.migration.entity_metadata_helper"
            - '@oro_entity_config.provider_config_bag'
            - '@oro_entity_config.configuration_handler'
        tags:
            - { name: oro_migration.extension, extension_name: extend }

    oro_entity_extend.migration.extension.convert_to_extend:
        class: Oro\Bundle\EntityExtendBundle\Migration\Extension\ConvertToExtendExtension
        arguments:
            - "@oro_entity_extend.migration.options_manager"
            - "@oro_entity_extend.migration.entity_metadata_helper"
            - "@oro_entity_config.config_model_manager"
        tags:
            - { name: oro_migration.extension, extension_name: convert_to_extend }

    oro_entity_extend.migration.extension.rename:
        class: Oro\Bundle\EntityExtendBundle\Migration\Extension\RenameExtension
        arguments:
            - "@oro_entity_extend.migration.options_manager"
        tags:
            - { name: oro_migration.extension, extension_name: rename, priority: -10 }

    oro_entity_extend.relation_builder:
        class: Oro\Bundle\EntityExtendBundle\Tools\RelationBuilder
        arguments:
            - "@oro_entity_config.config_manager"

    oro_entity_extend.association_builder:
        class: Oro\Bundle\EntityExtendBundle\Tools\AssociationBuilder
        arguments:
            - "@doctrine"
            - "@oro_entity_config.config_manager"
            - "@oro_entity_extend.relation_builder"

    oro_entity_extend.enum_synchronizer:
        class: Oro\Bundle\EntityExtendBundle\Tools\EnumSynchronizer
        arguments:
            - "@oro_entity_config.config_manager"
            - "@doctrine"
            - "@translator"
            - "@oro_entity_config.translation.helper"

    oro_entity_extend.twig.extension.dynamic_fields:
        class: Oro\Bundle\EntityExtendBundle\Twig\DynamicFieldsExtension
        public: false
        arguments:
            - '@oro_platform.twig.service_locator'
        tags:
            - { name: twig.extension }

    oro_entity_extend.twig.extension.enum:
        class: Oro\Bundle\EntityExtendBundle\Twig\EnumExtension
        public: false
        arguments:
            - "@oro_platform.twig.service_locator"
        tags:
            - { name: twig.extension }

    oro_entity_extend.datagrid.column_options_guesser:
        class: Oro\Bundle\EntityExtendBundle\Grid\ExtendColumnOptionsGuesser
        public: true
        arguments:
            - "@oro_entity_config.config_manager"
        tags:
            - { name: oro_datagrid.column_options_guesser }

    oro_entity_extend.datagrid.action.type.ajaxdeletefield:
        class: Oro\Bundle\EntityExtendBundle\Grid\Action\AjaxDeleteFieldAction
        shared: false
        tags:
            - { name: oro_datagrid.extension.action.type, type: ajaxdeletefield }

    oro_entity_extend.datagrid.action.type.ajaxrestorefield:
        class: Oro\Bundle\EntityExtendBundle\Grid\Action\AjaxRestoreFieldAction
        shared: false
        tags:
            - { name: oro_datagrid.extension.action.type, type: ajaxrestorefield }

    oro_entity_extend.validation_loader:
        class: Oro\Bundle\EntityExtendBundle\Validator\ExtendFieldValidationLoader
        public: false
        arguments:
            - "@oro_entity_config.provider.extend"
            - "@oro_entity_config.provider.form"
            - "@oro_entity_config.validator.field_config_constraints_factory"
        calls:
            -
                - addConstraints
                -
                    - integer
                    -
                        - Regex:
                            pattern: '/^\-{0,1}[\d+]*$/'
                            message: "This value should contain only numbers."
            -
                - addConstraints
                -
                    - smallint
                    -
                        - Regex:
                              pattern: '/^\-{0,1}[\d+]*$/'
                              message: "This value should contain only numbers."
            -
                - addConstraints
                -
                    - bigint
                    -
                        - Regex:
                              pattern: '/^\-{0,1}[\d+]*$/'
                              message: "This value should contain only numbers."
            - [addConstraints, ['float', [{ Type: {type: 'numeric'} }]]]
            - [addConstraints, ['decimal', [{ Type: {type: 'numeric'} }]]]
            - [addConstraints, ['money', [{ Type: {type: 'numeric'} }]]]
            - [addConstraints, ['percent', [{ Type: {type: 'numeric'} }]]]
            - [addConstraints, ['date', [{ Type: {type: 'DateTimeInterface', payload: {jsValidation: {type: Date}}}}]]]
            - [addConstraints, ['datetime', [{ Type: {type: 'DateTimeInterface', payload: {jsValidation: {type: DateTime}}}}]]]

    oro_entity_extend.listener.extend_field_value_render:
        class: Oro\Bundle\EntityExtendBundle\EventListener\ExtendFieldValueRenderListener
        arguments:
            - "@oro_entity_config.config_manager"
            - "@router"
            - "@doctrine"
            - "@security.authorization_checker"
            - "@oro_entity.entity_class_name_helper"
        tags:
            - { name: kernel.event_listener, event: oro.entity_extend_event.before_value_render, method: beforeValueRender }

    oro_entity_extend.importexport.normalizer.enum:
        class: Oro\Bundle\EntityExtendBundle\ImportExport\Serializer\EnumNormalizer
        arguments:
            - "@oro_entity.helper.field_helper"
        calls:
            - [setEnumValueProvider, ['@oro_entity_extend.enum_value_provider']]
        tags:
            - { name: oro_importexport.normalizer, priority: 20 }

    oro_entity_extend.listener.before_map_object_search_listener:
        class: Oro\Bundle\EntityExtendBundle\EventListener\BeforeMapObjectSearchListener
        arguments:
            - "@oro_entity_config.config_manager"
        tags:
            - { name: kernel.event_listener, event: oro_search.search_mapping_collect, method: prepareEntityMapEvent }

    oro_entity_extend.listener.search_entity_config_listener:
        class: Oro\Bundle\EntityExtendBundle\EventListener\SearchEntityConfigListener
        arguments:
            - "@oro_search.provider.search_mapping"
            - "@oro_search.async.indexer"
        tags:
            - { name: kernel.event_listener, event: oro.entity_config.pre_flush, method: preFlush }
            - { name: kernel.event_listener, event: oro.entity_config.post_flush, method: postFlush }

    oro_entity_extend.association_manager:
        class: Oro\Bundle\EntityExtendBundle\Entity\Manager\AssociationManager
        public: false
        arguments:
            - "@oro_entity_config.config_manager"
            - "@oro_entity_extend.acl_helper.link"
            - "@oro_entity.doctrine_helper"
            - "@oro_entity.entity_name_resolver"
            - "@oro_featuretoggle.checker.feature_checker"
        lazy: true

    oro_entity_extend.acl_helper.link:
        tags:
            - { name: oro_service_link, service: oro_security.acl_helper }

    oro_entity_extend.exclusion_provider:
        class: Oro\Bundle\EntityExtendBundle\Provider\ExtendExclusionProvider
        public: false
        arguments:
            - "@oro_entity_config.config_manager"
        tags:
            - { name: oro_entity.exclusion_provider.default }
            - { name: oro_entity.exclusion_provider.api, priority: 10 }

    oro_entity_extend.exclusion_provider.enum:
        class: Oro\Bundle\EntityExtendBundle\Provider\EnumExclusionProvider
        public: false
        arguments:
            - "@oro_entity_config.config_manager"
        tags:
            - { name: oro_entity.exclusion_provider.api, priority: -50 }

    oro_entity_extend.entity_alias_provider:
        class: Oro\Bundle\EntityExtendBundle\Provider\ExtendEntityAliasProvider
        public: false
        arguments:
            - "@oro_entity.entity_alias_config_bag"
            - "@oro_entity_config.config_manager"
            - "@oro_entity.entity_alias_duplicate_resolver"
            - '@Doctrine\Inflector\Inflector'
        tags:
            - { name: oro_entity.alias_provider, priority: -90 }

    oro_entity_extend.entity_class_name_provider.enum:
        class: Oro\Bundle\EntityExtendBundle\Provider\EnumEntityClassNameProvider
        public: false
        arguments:
            - "@oro_entity_config.config_manager"
            - "@translator"
            - '@Doctrine\Inflector\Inflector'
        tags:
            - { name: oro_entity.class_name_provider, priority: -110 }

    oro_entity_extend.enum_value_provider:
        class: Oro\Bundle\EntityExtendBundle\Provider\EnumValueProvider
        public: true
        arguments:
            - "@oro_entity.doctrine_helper"
            - "@oro_entity_extend.cache.enum_translation_provider"

    oro_entity_extend.dictionary_value_list_provider.enum:
        class: Oro\Bundle\EntityExtendBundle\Provider\EnumValueListProvider
        public: false
        arguments:
            - "@oro_entity_config.config_manager"
            - "@doctrine"
        tags:
            - { name: oro_entity.dictionary_value_list_provider, priority: -90 }

    oro_entity_extend.field_type_provider:
        class: Oro\Bundle\EntityExtendBundle\Provider\FieldTypeProvider
        public: false
        arguments:
            - "@oro_entity_config.config_manager"
            -
                - string
                - integer
                - smallint
                - bigint
                - boolean
                - decimal
                - date
                - datetime
                - text
                - float
                - money
                - percent
                - enum
                - multiEnum
            -
                #BAP-5875
                #- oneToOne
                - oneToMany
                - manyToOne
                - manyToMany

    oro_entity_extend.entity_alias_config_listener:
        class: Oro\Bundle\EntityExtendBundle\EventListener\EntityAliasConfigListener
        arguments:
            - '@oro_entity.entity_alias_resolver'
        tags:
            - { name: kernel.event_listener, event: oro.entity_config.pre_flush, method: preFlush }

    # Helpers
    oro_entity_extend.tools.class_method_name_checker:
        class: Oro\Bundle\EntityExtendBundle\Tools\ClassMethodNameChecker

    oro_entity_extend.model.action.request_enum_entity:
        class: Oro\Bundle\EntityExtendBundle\Model\Action\RequestEnumEntity
        arguments:
            - '@oro_action.expression.context_accessor'
            - '@doctrine'
        tags:
            - { name: oro_action.action, alias: request_enum_entity }

    oro_entity_extend.cache_warmer_aggregate:
        class: Oro\Bundle\EntityExtendBundle\Cache\CacheWarmerAggregate
        public: true
        arguments:
            - ~ # a link to "cache_warmer" service; injected by Oro\Bundle\EntityExtendBundle\DependencyInjection\Compiler\WarmerPass
            - ~ # a link to "oro_entity_extend.cache_warmer" service; injected by Oro\Bundle\EntityExtendBundle\DependencyInjection\Compiler\WarmerPass
            - '@oro_entity.database_checker.state_manager'

    oro_entity_extend.cache_warmer:
        class: Symfony\Component\HttpKernel\CacheWarmer\CacheWarmerAggregate
        public: true
        arguments:
            - !tagged_iterator oro_entity_extend.warmer

    oro_entity_extend.console_command_listener:
        class: Oro\Bundle\EntityExtendBundle\EventListener\ConsoleCommandListener
        arguments:
            - '@oro_entity.database_checker.state_manager'
        tags:
            - { name: kernel.event_listener, event: console.command, method: onConsoleCommand, priority: 255 }

    oro_entity_extend.enum_entity_name_provider:
        class: Oro\Bundle\EntityExtendBundle\Provider\EnumEntityNameProvider
        tags:
            - { name: oro_entity.name_provider }

    oro_entity_extend.event_listener.entity_structure_options_listener:
        class: Oro\Bundle\EntityExtendBundle\EventListener\EntityExtendedStructureOptionsListener
        arguments:
            - '@oro_entity.doctrine_helper'
        tags:
            - { name: kernel.event_listener, event: oro_entity.structure.options, method: onOptionsRequest }

    oro_entity_extend.async.orm_metadata_factory_clearer:
        class: Oro\Bundle\EntityExtendBundle\Async\OrmMetadataFactoryClearer
        public: false
        arguments:
            - '@service_container'
            - 'oro_entity_extend.orm.metadata_factory'
        tags:
            - { name: oro_message_queue.consumption.clearer, priority: -10 }

    oro_entity_extend.cache.enum_translation:
        public: false
        parent: oro.data.cache
        tags:
            - { name: 'cache.pool', namespace: 'oro_entity_extend_enum_trans' }

    oro_entity_extend.cache.enum_translation_provider:
        class: Oro\Bundle\EntityExtendBundle\Cache\EnumTranslationCache
        public: false
        arguments:
            - '@oro_entity_extend.cache.enum_translation'
            - '@oro_locale.helper.localization'
            - '@oro_locale.settings'

    oro_entity_extend.listener.cache.enum_value.abstract:
        abstract: true
        arguments:
            - '@oro_entity_extend.cache.enum_translation_provider'

    oro_entity_extend.listener.cache.enum_value_translation:
        class: Oro\Bundle\EntityExtendBundle\EventListener\Cache\EnumValueTranslationListener
        parent: oro_entity_extend.listener.cache.enum_value.abstract
        tags:
            - { name: doctrine.orm.entity_listener, entity: 'Oro\Bundle\EntityExtendBundle\Entity\EnumValueTranslation', event: postPersist }
            - { name: doctrine.orm.entity_listener, entity: 'Oro\Bundle\EntityExtendBundle\Entity\EnumValueTranslation', event: postUpdate }
            - { name: doctrine.orm.entity_listener, entity: 'Oro\Bundle\EntityExtendBundle\Entity\EnumValueTranslation', event: postRemove }

    oro_entity_extend.listener.cache.enum_value:
        class: Oro\Bundle\EntityExtendBundle\EventListener\Cache\EnumValueListener
        parent: oro_entity_extend.listener.cache.enum_value.abstract
        tags:
            - { name: doctrine.orm.entity_listener, entity: 'Oro\Bundle\EntityExtendBundle\Entity\AbstractEnumValue', event: postPersist }
            - { name: doctrine.orm.entity_listener, entity: 'Oro\Bundle\EntityExtendBundle\Entity\AbstractEnumValue', event: postUpdate }
            - { name: doctrine.orm.entity_listener, entity: 'Oro\Bundle\EntityExtendBundle\Entity\AbstractEnumValue', event: postRemove }

    oro_entity_extend.validator.field_name_length:
        class: Oro\Bundle\EntityExtendBundle\Validator\Constraints\FieldNameLengthValidator
        arguments:
            - '@oro_entity_extend.db_id_name_generator'
        tags:
            - { name: validator.constraint_validator, alias: oro_entity_extend.validator.field_name_length }

    oro_entity_extend.validator.attribute_field_validator:
        class: Oro\Bundle\EntityExtendBundle\Validator\Constraints\AttributeFieldValidator
        arguments:
            - '@oro_entity_extend.extend.field_name_validation_helper'
            - '@oro_entity_config.provider.attribute'
        tags:
            - { name: validator.constraint_validator, alias: oro_entity_extend.validator.attribute_field }

    oro_entity_extend.migration.update_html_escaped_type.pre.listener:
        class:  Oro\Bundle\EntityExtendBundle\EventListener\UpdateHtmlEscapedTypePreMigrationListener
        arguments:
            - '@oro_entity.doctrine_helper'
            - '@oro_entity_config.config_manager'
        tags:
            - { name: kernel.event_listener, event: oro_migration.pre_up, method: onPreUp }

    oro_entity_extend.validator.constraints.provider.decimal:
        class: Oro\Bundle\EntityExtendBundle\Validator\Constraints\Provider\DecimalFieldConfigConstraintsProvider
        tags:
            - { name: oro_entity_config.field_config_constraints_provider, type: decimal }

    oro_entity_extend.tools.save_schema_tool:
        class: Oro\Bundle\EntityExtendBundle\Tools\SaveSchemaTool
        arguments:
            - '@doctrine'
            - '@logger'

    oro_entity_extend.duplicator_filter_type.storage:
        class: 'Oro\Component\Duplicator\ObjectType'
        arguments:
            - extend_storage
            - Oro\Bundle\EntityExtendBundle\Duplicator\Filter\StorageFilter
        tags:
            - { name: oro_action.duplicate.filter_type }

    Oro\Bundle\EntityExtendBundle\EntityConfig\ExtendEntityConfiguration:
        tags:
            - oro_entity_config.validation.entity_config

    Oro\Bundle\EntityExtendBundle\EntityConfig\ExtendFieldConfiguration:
        tags:
            - oro_entity_config.validation.entity_config

    Oro\Bundle\EntityExtendBundle\EntityConfig\EnumEntityConfiguration:
        tags:
            - oro_entity_config.validation.entity_config

    Oro\Bundle\EntityExtendBundle\EntityConfig\EnumFieldConfiguration:
        tags:
            - oro_entity_config.validation.entity_config

    Oro\Bundle\EntityExtendBundle\EntityConfig\SearchEntityConfiguration:
        tags:
            - oro_entity_config.validation.entity_config

    Oro\Bundle\EntityExtendBundle\EntityConfig\SearchFieldConfiguration:
        tags:
            - oro_entity_config.validation.entity_config

    oro_entity_extend.accessor.property_accessor_with_dot_array_syntax:
        class: 'Oro\Bundle\EntityExtendBundle\EntityExtend\PropertyAccessorWithDotArraySyntax'
        factory: [ 'Oro\Bundle\EntityExtendBundle\PropertyAccess', createPropertyAccessorWithDotSyntax ]

    oro_entity_extend.accessor.property_access_factory:
        class: Oro\Bundle\EntityExtendBundle\PropertyAccess
        calls:
            - [ 'setCacheItemPool', [ '@oro_entity_extend.accessor.cache_item_pool' ] ]

    oro_entity_extend.accessor.cache_item_pool:
        parent: oro.data.cache
        tags:
            - { name: 'cache.pool', namespace: 'oro_entity_extend_property_accessor' }

    oro_entity_extend.twig.extension.get_attribute_node_extension:
        class: Oro\Bundle\EntityExtendBundle\Twig\GetAttributeNodeExtension
        tags:
            - { name: twig.extension }
