private function getManagersNode()
    {
        $builder = new TreeBuilder();
        $node = $builder->root('managers');

        $node
            ->isRequired()
            ->requiresAtLeastOneElement()
            ->useAttributeAsKey('name')
            ->info('Maps managers to connections and bundles')
            ->prototype('array')
                ->children()
                    ->arrayNode('index')
                        ->children()
                            ->scalarNode('index_name')
                                ->isRequired()
                                ->info('Sets index name for connection.')
                            ->end()
                            ->arrayNode('hosts')
                                ->info('Defines hosts to connect to.')
                                ->defaultValue(['127.0.0.1:9200'])
                                ->prototype('scalar')
                                ->end()
                            ->end()
                            ->arrayNode('settings')
                                ->defaultValue(
                                    [
                                        'number_of_replicas' => 0,
                                        'number_of_shards' => 1,
                                        'refresh_interval' => -1,
                                    ]
                                )
                                ->info('Sets index settings for connection.')
                                ->prototype('variable')->end()
                            ->end()
                        ->end()
                    ->end()
                    ->integerNode('bulk_size')
                        ->min(0)
                        ->defaultValue(100)
                        ->info(
                            'Maximum documents size in the bulk container. ' .
                            'When the limit is reached it will auto-commit.'
                        )
                    ->end()
                    ->enumNode('commit_mode')
                        ->values(['refresh', 'flush', 'none'])
                        ->defaultValue('refresh')
                        ->info(
                            'The default type of commit for bulk queries.'
                        )
                    ->end()
                    ->arrayNode('logger')
                        ->info('Enables elasticsearch queries logging')
                        ->addDefaultsIfNotSet()
                        ->beforeNormalization()
                            ->ifTrue(
                                function ($v) {
                                    return is_bool($v);
                                }
                            )
                            ->then(
                                function ($v) {
                                    return ['enabled' => $v];
                                }
                            )
                        ->end()
                        ->children()
                            ->booleanNode('enabled')
                                ->info('enables logging')
                                ->defaultFalse()
                            ->end()
                            ->scalarNode('level')
                                ->info('Sets PSR logging level.')
                                ->defaultValue(LogLevel::WARNING)
                                ->validate()
                                ->ifNotInArray((new \ReflectionClass('Psr\Log\LogLevel'))->getConstants())
                                    ->thenInvalid('Invalid PSR log level.')
                                ->end()
                            ->end()
                            ->scalarNode('log_file_name')
                                ->info('Log filename. By default it is a manager name.')
                                ->defaultValue(null)
                            ->end()
                        ->end()
                    ->end()
                    ->arrayNode('mappings')
                        ->info('Maps manager to the bundles. f.e. AppBundle')
                        ->prototype('variable')->end()
                    ->end()
                    ->booleanNode('force_commit')
                        ->info('Forces commit to the elasticsearch on kernel terminate event.')
                        ->defaultTrue()
                    ->end()
                ->end()
            ->end();

        return $node;
    }
private function getManagersNode()
    {
        $builder = new TreeBuilder();
        $node = $builder->root('managers');

        $node
            ->isRequired()
            ->requiresAtLeastOneElement()
            ->useAttributeAsKey('name')
            ->info('Maps managers to connections and bundles')
            ->prototype('array')
                ->children()
                    ->arrayNode('index')
                        ->children()
                            ->scalarNode('index_name')
                                ->isRequired()
                                ->info('Sets index name for connection.')
                            ->end()
                            ->arrayNode('hosts')
                                ->info('Defines hosts to connect to.')
                                ->defaultValue(['127.0.0.1:9200'])
                                ->prototype('scalar')
                                ->end()
                            ->end()
                            ->arrayNode('settings')
                                ->defaultValue(
                                    [
                                        'number_of_replicas' => 0,
                                        'number_of_shards' => 1,
                                        'refresh_interval' => -1,
                                    ]
                                )
                                ->info('Sets index settings for connection.')
                                ->prototype('variable')->end()
                            ->end()
                        ->end()
                    ->end()
                    ->integerNode('bulk_size')
                        ->min(0)
                        ->defaultValue(100)
                        ->info(
                            'Maximum documents size in the bulk container. ' .
                            'When the limit is reached it will auto-commit.'
                        )
                    ->end()
                    ->enumNode('commit_mode')
                        ->values(['refresh', 'flush', 'none'])
                        ->defaultValue('refresh')
                        ->info(
                            'The default type of commit for bulk queries.'
                        )
                    ->end()
                    ->arrayNode('logger')
                        ->info('Enables elasticsearch queries logging')
                        ->addDefaultsIfNotSet()
                        ->beforeNormalization()
                            ->ifTrue(
                                function ($v) {
                                    return is_bool($v);
                                }
                            )
                            ->then(
                                function ($v) {
                                    return ['enabled' => $v];
                                }
                            )
                        ->end()
                        ->children()
                            ->booleanNode('enabled')
                                ->info('enables logging')
                                ->defaultFalse()
                            ->end()
                            ->scalarNode('level')
                                ->info('Sets PSR logging level.')
                                ->defaultValue(LogLevel::WARNING)
                                ->validate()
                                ->ifNotInArray((new \ReflectionClass('Psr\Log\LogLevel'))->getConstants())
                                    ->thenInvalid('Invalid PSR log level.')
                                ->end()
                            ->end()
                            ->scalarNode('log_file_name')
                                ->info('Log filename. By default it is a manager name.')
                                ->defaultValue(null)
                            ->end()
                        ->end()
                    ->end()
                    ->arrayNode('mappings')
                        ->info('Maps manager to the bundles. f.e. AppBundle')
                        ->prototype('variable')->end()
                    ->end()
                    ->booleanNode('force_commit')
                        ->info('Forces commit to the elasticsearch on kernel terminate event.')
                        ->defaultTrue()
                    ->end()
                ->end()
            ->end();

        return $node;
    }
private function getManagersNode ( ) { $ builder = new TreeBuilder ( ) ; $ node = $ builder -> root ( 'managers' ) ; $ node -> isRequired ( ) -> requiresAtLeastOneElement ( ) -> useAttributeAsKey ( 'name' ) -> info ( 'Maps managers to connections and bundles' ) -> prototype ( 'array' ) -> children ( ) -> arrayNode ( 'index' ) -> children ( ) -> scalarNode ( 'index_name' ) -> isRequired ( ) -> info ( 'Sets index name for connection.' ) -> end ( ) -> arrayNode ( 'hosts' ) -> info ( 'Defines hosts to connect to.' ) -> defaultValue ( [ '127.0.0.1:9200' ] ) -> prototype ( 'scalar' ) -> end ( ) -> end ( ) -> arrayNode ( 'settings' ) -> defaultValue ( [ 'number_of_replicas' => 0 , 'number_of_shards' => 1 , 'refresh_interval' => - 1 , ] ) -> info ( 'Sets index settings for connection.' ) -> prototype ( 'variable' ) -> end ( ) -> end ( ) -> end ( ) -> end ( ) -> integerNode ( 'bulk_size' ) -> min ( 0 ) -> defaultValue ( 100 ) -> info ( 'Maximum documents size in the bulk container. ' . 'When the limit is reached it will auto-commit.' ) -> end ( ) -> enumNode ( 'commit_mode' ) -> values ( [ 'refresh' , 'flush' , 'none' ] ) -> defaultValue ( 'refresh' ) -> info ( 'The default type of commit for bulk queries.' ) -> end ( ) -> arrayNode ( 'logger' ) -> info ( 'Enables elasticsearch queries logging' ) -> addDefaultsIfNotSet ( ) -> beforeNormalization ( ) -> ifTrue ( function ( $ v ) { return is_bool ( $ v ) ; } ) -> then ( function ( $ v ) { return [ 'enabled' => $ v ] ; } ) -> end ( ) -> children ( ) -> booleanNode ( 'enabled' ) -> info ( 'enables logging' ) -> defaultFalse ( ) -> end ( ) -> scalarNode ( 'level' ) -> info ( 'Sets PSR logging level.' ) -> defaultValue ( LogLevel :: WARNING ) -> validate ( ) -> ifNotInArray ( ( new \ ReflectionClass ( 'Psr\Log\LogLevel' ) ) -> getConstants ( ) ) -> thenInvalid ( 'Invalid PSR log level.' ) -> end ( ) -> end ( ) -> scalarNode ( 'log_file_name' ) -> info ( 'Log filename. By default it is a manager name.' ) -> defaultValue ( null ) -> end ( ) -> end ( ) -> end ( ) -> arrayNode ( 'mappings' ) -> info ( 'Maps manager to the bundles. f.e. AppBundle' ) -> prototype ( 'variable' ) -> end ( ) -> end ( ) -> booleanNode ( 'force_commit' ) -> info ( 'Forces commit to the elasticsearch on kernel terminate event.' ) -> defaultTrue ( ) -> end ( ) -> end ( ) -> end ( ) ; return $ node ; }
Managers configuration node.

@return \Symfony\Component\Config\Definition\Builder\NodeDefinition
Managers configuration node .