Exponential 5.x Kernel 7.5.40 Exponential New Stack (Symfony-based) Kernel — PHP Class Reference

Templates.php
Go to the documentation of this file.
1 <?php
2
7 namespace eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\Parser;
8
9 use eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\AbstractParser;
10 use eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\SiteAccessAware\ContextualizerInterface;
11 use Symfony\Component\Config\Definition\Builder\NodeBuilder;
12
13 class Templates extends AbstractParser
14 {
20 public function addSemanticConfig(NodeBuilder $nodeBuilder)
21 {
22 $nodeBuilder
23 ->arrayNode(static::NODE_KEY)
24 ->info(static::INFO)
25 ->prototype('array')
26 ->children()
27 ->scalarNode('template')
28 ->info(static::INFO_TEMPLATE_KEY)
29 ->isRequired()
30 ->end()
31 ->scalarNode('priority')
32 ->defaultValue(0)
33 ->end()
34 ->end()
35 ->end()
36 ->end();
37 }
38
39 public function preMap(array $config, ContextualizerInterface $contextualizer)
40 {
41 foreach ($config['siteaccess']['groups'] as $group => $saArray) {
42 if (!empty($config[$contextualizer->getSiteAccessNodeName()][$group][static::NODE_KEY])) {
43 $contextualizer->setContextualParameter(
44 static::NODE_KEY,
45 $group,
46 $config[$contextualizer->getSiteAccessNodeName()][$group][static::NODE_KEY]
47 );
48 }
49 }
50
51 $contextualizer->mapConfigArray(static::NODE_KEY, $config);
52 }
53
54 public function mapConfig(array &$scopeSettings, $currentScope, ContextualizerInterface $contextualizer)
55 {
56 // Nothing to do here.
57 }
58 }
eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\AbstractParser
Definition: AbstractParser.php:12
eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\Parser\Templates
Definition: Templates.php:14
eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\Parser\Templates\mapConfig
mapConfig(array &$scopeSettings, $currentScope, ContextualizerInterface $contextualizer)
Does semantic config to internal container parameters mapping for $currentScope.
Definition: Templates.php:54
eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\Parser\Templates\preMap
preMap(array $config, ContextualizerInterface $contextualizer)
This method is called by the ConfigurationProcessor before looping over available scopes.
Definition: Templates.php:39
eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\Parser\Templates\addSemanticConfig
addSemanticConfig(NodeBuilder $nodeBuilder)
Adds semantic configuration definition.
Definition: Templates.php:20
eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\SiteAccessAware\ContextualizerInterface
Definition: ContextualizerInterface.php:12
eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\SiteAccessAware\ContextualizerInterface\getSiteAccessNodeName
getSiteAccessNodeName()
eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\SiteAccessAware\ContextualizerInterface\setContextualParameter
setContextualParameter($parameterName, $scope, $value)
Defines a contextual parameter in the container for given scope in current namespace.
eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\SiteAccessAware\ContextualizerInterface\mapConfigArray
mapConfigArray($id, array $config, $options=0)
Maps semantic array settings to internal format, and merges them between scopes.
eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\Parser
Definition: AbstractFieldTypeParser.php:7
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.