src/DependencyInjection/Compiler/AddDependencyCallsCompilerPass.php
public function applyConfigurationFromAttribute(Definition $definition, array $attributes)
    {
        $keys = [
            'model_manager',
            'form_contractor',
            'show_builder',
            'list_builder',
            'datagrid_builder',
            'translator',
            'configuration_pool',
            'router',
            'validator',
            'security_handler',
            'menu_factory',
            'route_builder',
            'label_translator_strategy',
        ];

        foreach ($keys as $key) {
            $method = 'set'.Inflector::classify($key);
            if (!isset($attributes[$key]) || $definition->hasMethodCall($method)) {
                continue;
            }

            $definition->addMethodCall($method, [new Reference($attributes[$key])]);
        }
    }
public function applyConfigurationFromAttribute(Definition $definition, array $attributes)
    {
        $keys = [
            'model_manager',
            'form_contractor',
            'show_builder',
            'list_builder',
            'datagrid_builder',
            'translator',
            'configuration_pool',
            'router',
            'validator',
            'security_handler',
            'menu_factory',
            'route_builder',
            'label_translator_strategy',
        ];

        foreach ($keys as $key) {
            $method = 'set'.Inflector::classify($key);
            if (!isset($attributes[$key]) || $definition->hasMethodCall($method)) {
                continue;
            }

            $definition->addMethodCall($method, [new Reference($attributes[$key])]);
        }
    }
public function applyConfigurationFromAttribute ( Definition $ definition , array $ attributes ) { $ keys = [ 'model_manager' , 'form_contractor' , 'show_builder' , 'list_builder' , 'datagrid_builder' , 'translator' , 'configuration_pool' , 'router' , 'validator' , 'security_handler' , 'menu_factory' , 'route_builder' , 'label_translator_strategy' , ] ; foreach ( $ keys as $ key ) { $ method = 'set' . Inflector :: classify ( $ key ) ; if ( ! isset ( $ attributes [ $ key ] ) || $ definition -> hasMethodCall ( $ method ) ) { continue ; } $ definition -> addMethodCall ( $ method , [ new Reference ( $ attributes [ $ key ] ) ] ) ; } }
This method read the attribute keys and configure admin class to use the related dependency.
This method read the attribute keys and configure admin class to use the related dependency .