vendor/symfony-cmf/menu-bundle/src/DependencyInjection/Configuration.php line 23

Open in your IDE?
  1. <?php
  2. /*
  3.  * This file is part of the Symfony CMF package.
  4.  *
  5.  * (c) 2011-2017 Symfony CMF
  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 Symfony\Cmf\Bundle\MenuBundle\DependencyInjection;
  11. use Symfony\Cmf\Bundle\MenuBundle\Doctrine\Phpcr\Menu;
  12. use Symfony\Cmf\Bundle\MenuBundle\Doctrine\Phpcr\MenuNode;
  13. use Symfony\Component\Config\Definition\Builder\TreeBuilder;
  14. use Symfony\Component\Config\Definition\ConfigurationInterface;
  15. class Configuration implements ConfigurationInterface
  16. {
  17.     public function getConfigTreeBuilder()
  18.     {
  19.         $treeBuilder = new TreeBuilder();
  20.         $treeBuilder->root('cmf_menu')
  21.             ->fixXmlConfig('voter')
  22.             ->children()
  23.                 ->arrayNode('persistence')
  24.                     ->addDefaultsIfNotSet()
  25.                     ->children()
  26.                         ->arrayNode('phpcr')
  27.                             ->addDefaultsIfNotSet()
  28.                             ->canBeEnabled()
  29.                             ->children()
  30.                                 ->scalarNode('menu_basepath')->defaultValue('/cms/menu')->end()
  31.                                 ->scalarNode('content_basepath')->defaultValue('/cms/content')->end()
  32.                                 ->integerNode('prefetch')->defaultValue(10)->end()
  33.                                 ->scalarNode('manager_name')->defaultNull()->end()
  34.                                 ->scalarNode('menu_document_class')->defaultValue(Menu::class)->end()
  35.                                 ->scalarNode('node_document_class')->defaultValue(MenuNode::class)->end()
  36.                             ->end()
  37.                         ->end()
  38.                     ->end()
  39.                 ->end()
  40.                 ->scalarNode('content_url_generator')->defaultValue('router')->end()
  41.                 ->booleanNode('allow_empty_items')->defaultFalse()->end()
  42.                 ->arrayNode('voters')
  43.                     ->children()
  44.                         ->arrayNode('content_identity')
  45.                             ->children()
  46.                                 ->scalarNode('content_key')->defaultNull()->end()
  47.                             ->end()
  48.                         ->end()
  49.                         ->scalarNode('uri_prefix')->defaultFalse()->end()
  50.                     ->end()
  51.                 ->end()
  52.                 ->arrayNode('publish_workflow')
  53.                     ->addDefaultsIfNotSet()
  54.                     ->children()
  55.                         ->enumNode('enabled')
  56.                             ->values([truefalse'auto'])
  57.                             ->defaultValue('auto')
  58.                         ->end()
  59.                     ->end()
  60.                 ->end()
  61.             ->end()
  62.         ;
  63.         return $treeBuilder;
  64.     }
  65. }