parameters:
    oro_entity_extend.migration.config_processor.options.path: %kernel.cache_dir%/oro_migration/extend_config_options.yml
    oro_entity_extend.entity.cache.warmer.class:              Oro\Bundle\EntityExtendBundle\Cache\EntityCacheWarmer
    oro_entity_extend.datagrid.extension.additional_fields.class:     Oro\Bundle\EntityExtendBundle\Grid\AdditionalFieldsExtension
    oro_entity_extend.datagrid.extension.dynamic_fields.class:        Oro\Bundle\EntityExtendBundle\Grid\DynamicFieldsExtension
    oro_entity_extend.form.extension.dynamic_fields.class:            Oro\Bundle\EntityExtendBundle\Form\Extension\DynamicFieldsExtension
    oro_entity_extend.tools.dumper.class:                     Oro\Bundle\EntityExtendBundle\Tools\ExtendConfigDumper
    oro_entity_extend.entity_config_dumper.extension.index.class:     Oro\Bundle\EntityExtendBundle\Tools\DumperExtensions\IndexEntityConfigDumperExtension
    oro_entity_extend.entity_config_dumper.extension.relation.class:  Oro\Bundle\EntityExtendBundle\Tools\DumperExtensions\RelationEntityConfigDumperExtension
    oro_entity_extend.entity_config_dumper.extension.enum.class:      Oro\Bundle\EntityExtendBundle\Tools\DumperExtensions\EnumEntityConfigDumperExtension
    oro_entity_extend.listener.config_subscriber.class:       Oro\Bundle\EntityExtendBundle\EventListener\ConfigSubscriber
    oro_entity_extend.extend.entity_processor.class:          Oro\Bundle\EntityExtendBundle\Extend\EntityProcessor
    oro_entity_extend.extend.field_type_helper.class:         Oro\Bundle\EntityExtendBundle\Extend\FieldTypeHelper
    oro_entity_extend.validator.not_sql_keyword.class:        Oro\Bundle\EntityExtendBundle\Validator\Constraints\NotSqlKeywordValidator
    oro_entity_extend.validator.unique_keys.class:            Oro\Bundle\EntityExtendBundle\Validator\Constraints\UniqueKeysValidator
    oro_entity_extend.validator.unique_enum_name.class:       Oro\Bundle\EntityExtendBundle\Validator\Constraints\UniqueEnumNameValidator
    oro_entity_extend.migration.config_processor.class:       Oro\Bundle\EntityExtendBundle\Migration\ExtendConfigProcessor
    oro_entity_extend.migration.refresh_cache.post_up.listener.class:  Oro\Bundle\EntityExtendBundle\EventListener\RefreshExtendCachePostUpMigrationListener
    oro_entity_extend.migration.update_config.post_up.listener.class:  Oro\Bundle\EntityExtendBundle\EventListener\UpdateExtendConfigPostUpMigrationListener
    oro_entity_extend.migration.update_indices.post_up.listener.class: Oro\Bundle\EntityExtendBundle\EventListener\UpdateExtendIndicesPostUpMigrationListener
    oro_entity_extend.migration.entity_metadata_helper.class: Oro\Bundle\EntityExtendBundle\Migration\EntityMetadataHelper
    oro_entity_extend.migration.options_manager.class:        Oro\Bundle\EntityExtendBundle\Migration\ExtendOptionsManager
    oro_entity_extend.migration.options_parser.class:         Oro\Bundle\EntityExtendBundle\Migration\ExtendOptionsParser
    oro_entity_extend.migration.extension.extend.class:       Oro\Bundle\EntityExtendBundle\Migration\Extension\ExtendExtension
    oro_entity_extend.migration.extension.rename.class:       Oro\Bundle\EntityExtendBundle\Migration\Extension\RenameExtension
    oro_entity_extend.entity_generator.class:                 Oro\Bundle\EntityExtendBundle\Tools\EntityGenerator
    oro_entity_extend.entity_generator.extension.class:       Oro\Bundle\EntityExtendBundle\Tools\GeneratorExtensions\ExtendEntityGeneratorExtension
    oro_entity_extend.relation_builder.class:                 Oro\Bundle\EntityExtendBundle\Tools\RelationBuilder
    oro_entity_extend.association_builder.class:              Oro\Bundle\EntityExtendBundle\Tools\AssociationBuilder
    oro_entity_extend.enum_synchronizer.class:                Oro\Bundle\EntityExtendBundle\Tools\EnumSynchronizer
    oro_entity_extend.enum_filter.class:                      Oro\Bundle\EntityExtendBundle\Filter\EnumFilter
    oro_entity_extend.multi_enum_filter.class:                Oro\Bundle\EntityExtendBundle\Filter\MultiEnumFilter
    oro_entity_extend.twig.extension.dynamic_fields.class:    Oro\Bundle\EntityExtendBundle\Twig\DynamicFieldsExtension
    oro_entity_extend.twig.extension.enum.class:              Oro\Bundle\EntityExtendBundle\Twig\EnumExtension
    oro_entity_extend.datagrid.column_options_guesser.class:  Oro\Bundle\EntityExtendBundle\Grid\ExtendColumnOptionsGuesser
    oro_entity_extend.datagrid.action.type.ajaxdeletefield.class:  Oro\Bundle\EntityExtendBundle\Grid\Action\AjaxDeleteFieldAction
    oro_entity_extend.validation_loader.class:                Oro\Bundle\EntityExtendBundle\Validator\ExtendFieldValidationLoader
    oro_entity_extend.listener.extend_field_value_render.class:  Oro\Bundle\EntityExtendBundle\EventListener\ExtendFieldValueRenderListener

services:
    oro_entity_extend.entity.cache.warmer:
        public: false
        class: %oro_entity_extend.entity.cache.warmer.class%
        arguments:
            - @oro_entity_extend.tools.dumper
        tags:
            - { name: kernel.cache_warmer,  priority: 30 }

    oro_entity_extend.datagrid.extension.additional_fields:
        class: %oro_entity_extend.datagrid.extension.additional_fields.class%
        arguments:
            - @oro_entity_config.config_manager
            - @oro_entity.orm.entity_class_resolver
            - @oro_datagrid.datagrid.guesser
        tags:
            - { name: oro_datagrid.extension }

    oro_entity_extend.datagrid.extension.dynamic_fields:
        class: %oro_entity_extend.datagrid.extension.dynamic_fields.class%
        arguments:
            - @oro_entity_config.config_manager
            - @oro_entity.orm.entity_class_resolver
            - @oro_datagrid.datagrid.guesser
        tags:
            - { name: oro_datagrid.extension }

    oro_entity_extend.form.extension.dynamic_fields:
        class: %oro_entity_extend.form.extension.dynamic_fields.class%
        arguments:
            - @oro_entity_config.config_manager
            - @router
            - @translator
        tags:
            - { name: form.type_extension, alias: form }

    oro_entity_extend.entity_generator:
        class: %oro_entity_extend.entity_generator.class%
        arguments:
            - %kernel.cache_dir%

    oro_entity_extend.entity_generator.extension:
        class: %oro_entity_extend.entity_generator.extension.class%
        tags:
            - { name: oro_entity_extend.entity_generator_extension, priority: 255 }

    oro_entity_extend.tools.dumper:
        class: %oro_entity_extend.tools.dumper.class%
        arguments:
            - @doctrine.orm.entity_manager
            - @oro_entity_extend.db_id_name_generator
            - @oro_entity_extend.extend.field_type_helper
            - @oro_entity_extend.entity_generator
            - %kernel.cache_dir%

    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_entity_extend.entity_config_dumper.extension.index.class%
        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_entity_extend.entity_config_dumper.extension.relation.class%
        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_entity_extend.entity_config_dumper.extension.enum.class%
        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
        tags:
            - { name: oro_entity_extend.entity_config_dumper_extension }

    oro_entity_extend.listener.config_subscriber:
        class: %oro_entity_extend.listener.config_subscriber.class%
        arguments:
            - @oro_entity_config.provider.extend
        tags:
            - { name: kernel.event_subscriber}

    oro_entity_extend.db_id_name_generator:
        alias: oro_migration.db_id_name_generator

    oro_entity_extend.validator.not_sql_keyword:
        class: %oro_entity_extend.validator.not_sql_keyword.class%
        arguments:
            - @doctrine
        tags:
            - { name: validator.constraint_validator, alias: oro_entity_extend.validator.not_sql_keyword }

    oro_entity_extend.validator.unique_keys:
        class: %oro_entity_extend.validator.unique_keys.class%
        tags:
            - { name: validator.constraint_validator, alias: oro_entity_extend.validator.unique_keys }

    oro_entity_extend.validator.unique_enum_name:
        class: %oro_entity_extend.validator.unique_enum_name.class%
        arguments:
            - @oro_entity_config.config_manager
        tags:
            - { name: validator.constraint_validator, alias: oro_entity_extend.validator.unique_enum_name }

    oro_entity_extend.migration.config_processor:
        class: %oro_entity_extend.migration.config_processor.class%
        arguments:
            - @oro_entity_config.config_manager

    oro_entity_extend.extend.entity_processor:
        class: %oro_entity_extend.extend.entity_processor.class%
        arguments:
            - @oro_platform.maintenance
            - @oro_entity_config.config_manager
            - @oro_entity_config.tools.command_executor
            - @logger

    oro_entity_extend.extend.field_type_helper:
        class: %oro_entity_extend.extend.field_type_helper.class%
        arguments:
            - []

    oro_entity_extend.migration.refresh_cache_before_entity_config_update.post_up.listener:
        class: %oro_entity_extend.migration.refresh_cache.post_up.listener.class%
        arguments:
            - @oro_entity_config.tools.command_executor
            - @oro_entity_config.config_manager
        tags:
            - { name: kernel.event_listener, event: oro_migration.post_up, method: onPostUp, priority: -85 }

    oro_entity_extend.migration.update_config.post_up.listener:
        class: %oro_entity_extend.migration.update_config.post_up.listener.class%
        arguments:
            - @oro_entity_config.tools.command_executor
            - %oro_entity_extend.migration.config_processor.options.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_entity_extend.migration.update_indices.post_up.listener.class%
        arguments:
            - @oro_entity_extend.migration.entity_metadata_helper
        tags:
            - { name: kernel.event_listener, event: oro_migration.post_up, method: onPostUp, priority: -120 }

    oro_entity_extend.migration.entity_metadata_helper:
        class: %oro_entity_extend.migration.entity_metadata_helper.class%
        arguments:
            - @doctrine

    oro_entity_extend.migration.options_manager:
        class: %oro_entity_extend.migration.options_manager.class%

    oro_entity_extend.migration.options_parser:
        class: %oro_entity_extend.migration.options_parser.class%
        arguments:
            - @oro_entity_extend.migration.entity_metadata_helper
            - @oro_entity_extend.extend.field_type_helper

    oro_entity_extend.migration.extension.extend:
        class: %oro_entity_extend.migration.extension.extend.class%
        arguments:
            - @oro_entity_extend.migration.options_manager
            - @oro_entity_extend.migration.entity_metadata_helper
        tags:
            - { name: oro_migration.extension, extension_name: extend }

    oro_entity_extend.migration.extension.rename:
        class: %oro_entity_extend.migration.extension.rename.class%
        arguments:
            - @oro_entity_extend.migration.options_manager
        tags:
            - { name: oro_migration.extension, extension_name: rename, priority: -10 }

    oro_entity_extend.relation_builder:
        class: %oro_entity_extend.relation_builder.class%
        arguments:
            - @oro_entity_config.config_manager

    oro_entity_extend.association_builder:
        class: %oro_entity_extend.association_builder.class%
        arguments:
            - @oro_entity_config.config_manager
            - @oro_entity_extend.relation_builder

    oro_entity_extend.enum_synchronizer:
        class: %oro_entity_extend.enum_synchronizer.class%
        arguments:
            - @oro_entity_config.config_manager
            - @doctrine
            - @translator
            - @oro_translation.database_translation.metadata.cache

    oro_entity_extend.enum_filter:
        class: %oro_entity_extend.enum_filter.class%
        arguments:
            - @form.factory
            - @oro_filter.filter_utility
        tags:
            - { name: oro_filter.extension.orm_filter.filter, type: enum }

    oro_entity_extend.multi_enum_filter:
        class: %oro_entity_extend.multi_enum_filter.class%
        arguments:
            - @form.factory
            - @oro_filter.filter_utility
            - @oro_filter.builder.many_relation
        tags:
            - { name: oro_filter.extension.orm_filter.filter, type: multi_enum }

    oro_entity_extend.twig.extension.dynamic_fields:
        class: %oro_entity_extend.twig.extension.dynamic_fields.class%
        arguments:
            - @oro_entity_config.config_manager
            - @oro_entity_extend.extend.field_type_helper
            - @event_dispatcher
        tags:
            - { name: twig.extension }

    oro_entity_extend.twig.extension.enum:
        class: %oro_entity_extend.twig.extension.enum.class%
        arguments:
            - @doctrine
        tags:
            - { name: twig.extension }

    oro_entity_extend.datagrid.column_options_guesser:
        class: %oro_entity_extend.datagrid.column_options_guesser.class%
        arguments:
            - @oro_entity_config.config_manager
        tags:
            - { name: oro_datagrid.column_options_guesser }

    oro_entity_extend.datagrid.action.type.ajaxdeletefield:
        class: %oro_entity_extend.datagrid.action.type.ajaxdeletefield.class%
        scope: prototype
        tags:
            - { name: oro_datagrid.extension.action.type, type: ajaxdeletefield }

    oro_entity_extend.validation_loader:
        class: %oro_entity_extend.validation_loader.class%
        public: false
        arguments:
            - @oro_entity_config.provider.extend
            - @oro_entity_config.provider.form
        calls:
            -
                - addConstraints
                -
                    - integer
                    -
                        - Regex:
                            pattern: "/^[\d+]*$/"
                            message: "This value should contain only numbers."

    oro_entity_extend.listener.extend_field_value_render:
        class: %oro_entity_extend.listener.extend_field_value_render.class%
        arguments:
            - @oro_entity_config.config_manager
            - @router
            - @oro_entity_extend.extend.field_type_helper
            - @doctrine.orm.entity_manager
        tags:
            - { name: kernel.event_listener, event: oro.entity_extend_event.before_value_render, method: beforeValueRender }
