From d61258e1f2fc3ab57e5535f27cdf75c138f70813 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rapha=C3=ABl=20Gertz?= Date: Mon, 7 Dec 2020 23:56:05 +0100 Subject: [PATCH 1/1] Add default title and group --- DependencyInjection/Configuration.php | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php index a8c0324..63ba75f 100644 --- a/DependencyInjection/Configuration.php +++ b/DependencyInjection/Configuration.php @@ -20,11 +20,15 @@ class Configuration implements ConfigurationInterface { //The bundle default values $defaults = [ - 'class' => [ + 'class' => [ 'group' => 'Rapsys\\UserBundle\\Entity\\Group', 'title' => 'Rapsys\\UserBundle\\Entity\\Title', 'user' => 'Rapsys\\UserBundle\\Entity\\User' ], + 'default' => [ + 'title' => 'Mister', + 'group' => [ 'User' ] + ], 'route' => [ 'index' => [ 'name' => 'rapsys_user_index', @@ -123,6 +127,17 @@ class Configuration implements ConfigurationInterface { ->scalarNode('user')->cannotBeEmpty()->defaultValue($defaults['class']['user'])->end() ->end() ->end() + ->arrayNode('default') + ->addDefaultsIfNotSet() + ->children() + ->scalarNode('title')->cannotBeEmpty()->defaultValue($defaults['default']['title'])->end() + ->arrayNode('group') + ->treatNullLike(array()) + ->defaultValue($defaults['default']['group']) + ->scalarPrototype()->end() + ->end() + ->end() + ->end() ->arrayNode('route') ->addDefaultsIfNotSet() ->children() -- 2.41.1