vendor/sg/datatablesbundle/DependencyInjection/Configuration.php line 31

Open in your IDE?
  1. <?php
  2. /**
  3.  * This file is part of the SgDatatablesBundle package.
  4.  *
  5.  * (c) stwe <https://github.com/stwe/DatatablesBundle>
  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 Sg\DatatablesBundle\DependencyInjection;
  11. use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
  12. use Symfony\Component\Config\Definition\Builder\TreeBuilder;
  13. use Symfony\Component\Config\Definition\ConfigurationInterface;
  14. /**
  15.  * Class Configuration
  16.  *
  17.  * @package Sg\DatatablesBundle\DependencyInjection
  18.  */
  19. class Configuration implements ConfigurationInterface
  20. {
  21.     /**
  22.      * {@inheritDoc}
  23.      */
  24.     public function getConfigTreeBuilder()
  25.     {
  26.         $treeBuilder = new TreeBuilder();
  27.         $rootNode $treeBuilder->root('sg_datatables');
  28.         $this->addDatatableSection($rootNode);
  29.         return $treeBuilder;
  30.     }
  31.     /**
  32.      * Add datatable section.
  33.      *
  34.      * @param ArrayNodeDefinition $rootNode
  35.      */
  36.     private function addDatatableSection(ArrayNodeDefinition $rootNode)
  37.     {
  38.         $rootNode
  39.             ->children()
  40.                 ->arrayNode('datatable')->addDefaultsIfNotSet()
  41.                     ->children()
  42.                         ->arrayNode('query')->addDefaultsIfNotSet()
  43.                             ->children()
  44.                                 ->booleanNode('translation_query_hints')
  45.                                     ->defaultFalse()
  46.                                 ->end()
  47.                             ->end()
  48.                         ->end()
  49.                     ->end()
  50.                 ->end()
  51.             ->end()
  52.         ;
  53.     }
  54. }