[ Index ]

PHP Cross Reference of phpBB-3.1.12-deutsch

title

Body

[close]

/vendor/symfony/config/Symfony/Component/Config/Definition/Builder/ -> ArrayNodeDefinition.php (summary)

(no description)

File Size: 497 lines (15 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

ArrayNodeDefinition:: (21 methods):
  __construct()
  setBuilder()
  children()
  prototype()
  addDefaultsIfNotSet()
  addDefaultChildrenIfNoneSet()
  requiresAtLeastOneElement()
  disallowNewKeysInSubsequentConfigs()
  fixXmlConfig()
  useAttributeAsKey()
  canBeUnset()
  canBeEnabled()
  canBeDisabled()
  performNoDeepMerging()
  ignoreExtraKeys()
  normalizeKeys()
  append()
  getNodeBuilder()
  createNode()
  validateConcreteNode()
  validatePrototypeNode()


Class: ArrayNodeDefinition  - X-Ref

This class provides a fluent interface for defining an array node.

__construct($name, NodeParentInterface $parent = null)   X-Ref
{@inheritdoc}


setBuilder(NodeBuilder $builder)   X-Ref
Sets a custom children builder.

param: NodeBuilder $builder A custom NodeBuilder

children()   X-Ref
Returns a builder to add children nodes.

return: NodeBuilder

prototype($type)   X-Ref
Sets a prototype for child nodes.

param: string $type the type of node
return: NodeDefinition

addDefaultsIfNotSet()   X-Ref
Adds the default value if the node is not set in the configuration.

This method is applicable to concrete nodes only (not to prototype nodes).
If this function has been called and the node is not set during the finalization
phase, it's default value will be derived from its children default values.

return: ArrayNodeDefinition

addDefaultChildrenIfNoneSet($children = null)   X-Ref
Adds children with a default value when none are defined.

param: int|string|array|null $children The number of children|The child name|The children names to be added
return: ArrayNodeDefinition

requiresAtLeastOneElement()   X-Ref
Requires the node to have at least one element.

This method is applicable to prototype nodes only.

return: ArrayNodeDefinition

disallowNewKeysInSubsequentConfigs()   X-Ref
Disallows adding news keys in a subsequent configuration.

If used all keys have to be defined in the same configuration file.

return: ArrayNodeDefinition

fixXmlConfig($singular, $plural = null)   X-Ref
Sets a normalization rule for XML configurations.

param: string $singular The key to remap
param: string $plural   The plural of the key for irregular plurals
return: ArrayNodeDefinition

useAttributeAsKey($name, $removeKeyItem = true)   X-Ref
Sets the attribute which value is to be used as key.

This is useful when you have an indexed array that should be an
associative array. You can select an item from within the array
to be the key of the particular item. For example, if "id" is the
"key", then:

array(
array('id' => 'my_name', 'foo' => 'bar'),
);

becomes

array(
'my_name' => array('foo' => 'bar'),
);

If you'd like "'id' => 'my_name'" to still be present in the resulting
array, then you can set the second argument of this method to false.

This method is applicable to prototype nodes only.

param: string $name          The name of the key
param: bool   $removeKeyItem Whether or not the key item should be removed.
return: ArrayNodeDefinition

canBeUnset($allow = true)   X-Ref
Sets whether the node can be unset.

param: bool $allow
return: ArrayNodeDefinition

canBeEnabled()   X-Ref
Adds an "enabled" boolean to enable the current section.

By default, the section is disabled. If any configuration is specified then
the node will be automatically enabled:

enableableArrayNode: {enabled: true, ...}   # The config is enabled & default values get overridden
enableableArrayNode: ~                      # The config is enabled & use the default values
enableableArrayNode: true                   # The config is enabled & use the default values
enableableArrayNode: {other: value, ...}    # The config is enabled & default values get overridden
enableableArrayNode: {enabled: false, ...}  # The config is disabled
enableableArrayNode: false                  # The config is disabled

return: ArrayNodeDefinition

canBeDisabled()   X-Ref
Adds an "enabled" boolean to enable the current section.

By default, the section is enabled.

return: ArrayNodeDefinition

performNoDeepMerging()   X-Ref
Disables the deep merging of the node.

return: ArrayNodeDefinition

ignoreExtraKeys()   X-Ref
Allows extra config keys to be specified under an array without
throwing an exception.

Those config values are simply ignored and removed from the
resulting array. This should be used only in special cases where
you want to send an entire configuration array through a special
tree that processes only part of the array.

return: ArrayNodeDefinition

normalizeKeys($bool)   X-Ref
Sets key normalization.

param: bool $bool Whether to enable key normalization
return: ArrayNodeDefinition

append(NodeDefinition $node)   X-Ref
Appends a node definition.

$node = new ArrayNodeDefinition()
->children()
->scalarNode('foo')->end()
->scalarNode('baz')->end()
->end()
->append($this->getBarNodeDefinition())
;

param: NodeDefinition $node A NodeDefinition instance
return: ArrayNodeDefinition This node

getNodeBuilder()   X-Ref
Returns a node builder to be used to add children and prototype.

return: NodeBuilder The node builder

createNode()   X-Ref
{@inheritdoc}


validateConcreteNode(ArrayNode $node)   X-Ref
Validate the configuration of a concrete node.

param: ArrayNode $node The related node

validatePrototypeNode(PrototypedArrayNode $node)   X-Ref
Validate the configuration of a prototype node.

param: PrototypedArrayNode $node The related node



Generated: Thu Jan 11 00:25:41 2018 Cross-referenced by PHPXref 0.7.1