1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- <?php
- /*
- * This file is part of the Sonata project.
- *
- * (c) Thomas Rabaix <thomas.rabaix@sonata-project.org>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
- namespace Sonata\DoctrineORMAdminBundle\DependencyInjection;
- use Symfony\Component\Config\Definition\Builder\TreeBuilder;
- use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
- use Symfony\Component\Config\Definition\ConfigurationInterface;
- /**
- * This class contains the configuration information for the bundle
- *
- * This information is solely responsible for how the different configuration
- * sections are normalized, and merged.
- *
- * @author Michael Williams <mtotheikle@gmail.com>
- */
- class Configuration implements ConfigurationInterface
- {
- /**
- * Generates the configuration tree.
- *
- * @return \Symfony\Component\Config\Definition\Builder\TreeBuilder
- */
- public function getConfigTreeBuilder()
- {
- $treeBuilder = new TreeBuilder();
- $rootNode = $treeBuilder->root('sonata_doctrine_orm_admin', 'array');
- $rootNode
- ->children()
- ->scalarNode('entity_manager')->defaultNull()->end()
- ->arrayNode('templates')
- ->addDefaultsIfNotSet()
- ->children()
- ->arrayNode('form')
- ->prototype('scalar')->end()
- ->defaultValue(array('SonataDoctrineORMAdminBundle:Form:form_admin_fields.html.twig'))
- ->end()
- ->arrayNode('filter')
- ->prototype('scalar')->end()
- ->defaultValue(array('SonataDoctrineORMAdminBundle:Form:filter_admin_fields.html.twig'))
- ->end()
- ->arrayNode('types')
- ->children()
- ->arrayNode('list')
- ->useAttributeAsKey('name')
- ->prototype('scalar')->end()
- ->end()
- ->arrayNode('show')
- ->useAttributeAsKey('name')
- ->prototype('scalar')->end()
- ->end()
- ->end()
- ->end()
- ->end()
- ->end()
- ->end()
- ;
- return $treeBuilder;
- }
- }
|