Configuration.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. /*
  3. * This file is part of the Sonata package.
  4. *
  5. * (c) Thomas Rabaix <thomas.rabaix@sonata-project.org>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Sonata\UserBundle\DependencyInjection;
  11. use Symfony\Component\Config\Definition\Builder\TreeBuilder;
  12. use Symfony\Component\Config\Definition\ConfigurationInterface;
  13. /**
  14. * This is the class that validates and merges configuration from your app/config files
  15. *
  16. * To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html#cookbook-bundles-extension-config-class}
  17. */
  18. class Configuration implements ConfigurationInterface
  19. {
  20. /**
  21. * {@inheritDoc}
  22. */
  23. public function getConfigTreeBuilder()
  24. {
  25. $treeBuilder = new TreeBuilder();
  26. $rootNode = $treeBuilder->root('sonata_user');
  27. $rootNode
  28. ->children()
  29. ->arrayNode('class')
  30. ->addDefaultsIfNotSet()
  31. ->children()
  32. ->scalarNode('group')->defaultValue('Application\\Sonata\\UserBundle\\Entity\\User')->end()
  33. ->scalarNode('user')->defaultValue('Application\\Sonata\\UserBundle\\Entity\\Group')->end()
  34. ->end()
  35. ->end()
  36. ->end()
  37. ;
  38. return $treeBuilder;
  39. }
  40. }