NodeBuilder
class NodeBuilder implements NodeParentInterface
This class provides a fluent interface for building a node.
Properties
protected | $parent | ||
protected | $nodeMapping |
Methods
__construct()
No description
$this
arrayNode(string $name)
Creates a child array node.
scalarNode(string $name)
Creates a child scalar node.
booleanNode(string $name)
Creates a child Boolean node.
integerNode(string $name)
Creates a child integer node.
floatNode(string $name)
Creates a child float node.
enumNode(string $name)
Creates a child EnumNode.
variableNode(string $name)
Creates a child variable node.
NodeDefinition&ParentNodeDefinitionInterface
end()
Returns the parent node.
node(string|null $name, string $type)
Creates a child node.
$this
$this
setNodeClass(string $type, string $class)
Adds or overrides a node Type.
string
getNodeClass(string $type)
Returns the class name of the node definition.
Details
$this
append(NodeDefinition $node)
Appends a node definition.
Usage:
$node = new ArrayNodeDefinition('name')
->children()
->scalarNode('foo')->end()
->scalarNode('baz')->end()
->append($this->getBarNodeDefinition())
->end()
;