class NodeBuilder implements NodeParentInterface
This class provides a fluent interface for building a node.
protected | $parent | ||
protected | $nodeMapping |
__construct() | ||
$this | setParent(ParentNodeDefinitionInterface $parent = null) Set the parent node. | |
ArrayNodeDefinition | arrayNode(string $name) Creates a child array node. | |
ScalarNodeDefinition | scalarNode(string $name) Creates a child scalar node. | |
BooleanNodeDefinition | booleanNode(string $name) Creates a child Boolean node. | |
IntegerNodeDefinition | integerNode(string $name) Creates a child integer node. | |
FloatNodeDefinition | floatNode(string $name) Creates a child float node. | |
EnumNodeDefinition | enumNode(string $name) Creates a child EnumNode. | |
VariableNodeDefinition | variableNode(string $name) Creates a child variable node. | |
ParentNodeDefinitionInterface|NodeDefinition | end() Returns the parent node. | |
NodeDefinition | node(string|null $name, string $type) Creates a child node. | |
$this | append(NodeDefinition $node) Appends a node definition. | |
$this | setNodeClass(string $type, string $class) Adds or overrides a node Type. | |
string | getNodeClass(string $type) Returns the class name of the node definition. |
Set the parent node.
ParentNodeDefinitionInterface | $parent |
$this |
Creates a child array node.
string | $name | The name of the node |
ArrayNodeDefinition | The child node |
Creates a child scalar node.
string | $name | The name of the node |
ScalarNodeDefinition | The child node |
Creates a child Boolean node.
string | $name | The name of the node |
BooleanNodeDefinition | The child node |
Creates a child integer node.
string | $name | The name of the node |
IntegerNodeDefinition | The child node |
Creates a child float node.
string | $name | The name of the node |
FloatNodeDefinition | The child node |
Creates a child EnumNode.
string | $name |
EnumNodeDefinition |
Creates a child variable node.
string | $name | The name of the node |
VariableNodeDefinition | The builder of the child node |
Returns the parent node.
ParentNodeDefinitionInterface|NodeDefinition | The parent node |
Creates a child node.
string|null | $name | The name of the node |
string | $type | The type of the node |
NodeDefinition | The child node |
RuntimeException | When the node type is not registered |
RuntimeException | When the node class is not found |
Appends a node definition.
Usage:
$node = new ArrayNodeDefinition('name')
->children()
->scalarNode('foo')->end()
->scalarNode('baz')->end()
->append($this->getBarNodeDefinition())
->end()
;
NodeDefinition | $node |
$this |
Adds or overrides a node Type.
string | $type | The name of the type |
string | $class | The fully qualified name the node definition class |
$this |
Returns the class name of the node definition.
string | $type | The node type |
string | The node definition class name |
RuntimeException | When the node type is not registered |
RuntimeException | When the node class is not found |
© 2004–2017 Fabien Potencier
Licensed under the MIT License.
https://api.symfony.com/4.1/Symfony/Component/Config/Definition/Builder/NodeBuilder.html