From 809db9f7e1a45b578583bfcbe7f7f19244104aaf Mon Sep 17 00:00:00 2001 From: Vincent Langlet Date: Thu, 26 Nov 2020 19:55:06 +0100 Subject: [PATCH] Add data source in configuration and documentation --- .../cookbook/recipe_overwrite_admin_configuration.rst | 11 ++++++----- docs/reference/advanced_configuration.rst | 1 + docs/reference/architecture.rst | 3 ++- docs/reference/configuration.rst | 1 + .../Compiler/AddDependencyCallsCompilerPass.php | 1 + src/DependencyInjection/Configuration.php | 1 + 6 files changed, 12 insertions(+), 6 deletions(-) diff --git a/docs/cookbook/recipe_overwrite_admin_configuration.rst b/docs/cookbook/recipe_overwrite_admin_configuration.rst index 7cd6fe4728f..105fd1b796d 100644 --- a/docs/cookbook/recipe_overwrite_admin_configuration.rst +++ b/docs/cookbook/recipe_overwrite_admin_configuration.rst @@ -14,11 +14,12 @@ with the following templates: admin_services: id.of.admin.service: # service configuration - model_manager: sonata.admin.manager.doctrine_orm - form_contractor: sonata.admin.builder.doctrine_orm - show_builder: sonata.admin.builder.doctrine_orm - list_builder: sonata.admin.builder.doctrine_orm - datagrid_builder: sonata.admin.builder.doctrine_orm + model_manager: sonata.admin.manager.orm + data_source: sonata.admin.data_source.orm + form_contractor: sonata.admin.builder.orm_form + show_builder: sonata.admin.builder.orm_show + list_builder: sonata.admin.builder.orm_list + datagrid_builder: sonata.admin.builder.orm_datagrid translator: translator configuration_pool: sonata.admin.pool route_generator: sonata.admin.route.default_generator diff --git a/docs/reference/advanced_configuration.rst b/docs/reference/advanced_configuration.rst index d38c156c759..62586364f14 100644 --- a/docs/reference/advanced_configuration.rst +++ b/docs/reference/advanced_configuration.rst @@ -11,6 +11,7 @@ the services which are injected by default are: Dependencies Service ID ========================= =================================================================== model_manager sonata.admin.manager.%manager-type% +data_source sonata.admin.data_source.%manager-type% form_contractor sonata.admin.builder.%manager-type%_form show_builder sonata.admin.builder.%manager-type%_show list_builder sonata.admin.builder.%manager-type%_list diff --git a/docs/reference/architecture.rst b/docs/reference/architecture.rst index 98deece176b..75cd591bb58 100644 --- a/docs/reference/architecture.rst +++ b/docs/reference/architecture.rst @@ -38,7 +38,8 @@ injected by the bundle: Class Description ========================= ========================================================================= ConfigurationPool configuration pool where all Admin class instances are stored -ModelManager service which handles specific code relating to your persistence layer (e.g. Doctrine ORM) +ModelManager handles specific code relating to your persistence layer (e.g. Doctrine ORM) +DataSource handles code related to the sonata exporter FormContractor builds the forms for the edit/create views using the Symfony ``FormBuilder`` ShowBuilder builds the show fields ListBuilder builds the list fields diff --git a/docs/reference/configuration.rst b/docs/reference/configuration.rst index 0eb6c682fee..b6e5ebacf9a 100644 --- a/docs/reference/configuration.rst +++ b/docs/reference/configuration.rst @@ -120,6 +120,7 @@ Full Configuration Options class: col-md-4 admin_services: model_manager: null + data_source: null form_contractor: null show_builder: null list_builder: null diff --git a/src/DependencyInjection/Compiler/AddDependencyCallsCompilerPass.php b/src/DependencyInjection/Compiler/AddDependencyCallsCompilerPass.php index 854767da767..a4f580ef6e1 100644 --- a/src/DependencyInjection/Compiler/AddDependencyCallsCompilerPass.php +++ b/src/DependencyInjection/Compiler/AddDependencyCallsCompilerPass.php @@ -225,6 +225,7 @@ public function applyConfigurationFromAttribute(Definition $definition, array $a { $keys = [ 'model_manager', + 'data_source', 'form_contractor', 'show_builder', 'list_builder', diff --git a/src/DependencyInjection/Configuration.php b/src/DependencyInjection/Configuration.php index 695fc96dcf5..0c4b0b28aa5 100644 --- a/src/DependencyInjection/Configuration.php +++ b/src/DependencyInjection/Configuration.php @@ -345,6 +345,7 @@ public function getConfigTreeBuilder() ->arrayNode('admin_services') ->prototype('array') ->children() + ->scalarNode('data_source')->defaultNull()->end() ->scalarNode('model_manager')->defaultNull()->end() ->scalarNode('form_contractor')->defaultNull()->end() ->scalarNode('show_builder')->defaultNull()->end()