Documentation

NodeBuilder
in package
implements NodeParentInterface

This class provides a fluent interface for building a node.

Tags
author

Johannes M. Schmitt schmittjoh@gmail.com

Table of Contents

Interfaces

NodeParentInterface
An interface that must be implemented by all node parents.

Properties

$nodeMapping  : mixed
$parent  : mixed

Methods

__construct()  : mixed
append()  : $this
Appends a node definition.
arrayNode()  : ArrayNodeDefinition
Creates a child array node.
booleanNode()  : BooleanNodeDefinition
Creates a child Boolean node.
end()  : NodeDefinition|ParentNodeDefinitionInterface
Returns the parent node.
enumNode()  : EnumNodeDefinition
Creates a child EnumNode.
floatNode()  : FloatNodeDefinition
Creates a child float node.
integerNode()  : IntegerNodeDefinition
Creates a child integer node.
node()  : NodeDefinition
Creates a child node.
scalarNode()  : ScalarNodeDefinition
Creates a child scalar node.
setNodeClass()  : $this
Adds or overrides a node Type.
setParent()  : $this
Set the parent node.
variableNode()  : VariableNodeDefinition
Creates a child variable node.
getNodeClass()  : string
Returns the class name of the node definition.

Properties

Methods

append()

Appends a node definition.

public append(NodeDefinition $node) : $this

Usage:

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

Parameters
$node : NodeDefinition
Return values
$this

node()

Creates a child node.

public node(string|null $name, string $type) : NodeDefinition
Parameters
$name : string|null
$type : string
Tags
throws
RuntimeException

When the node type is not registered

throws
RuntimeException

When the node class is not found

Return values
NodeDefinition

setNodeClass()

Adds or overrides a node Type.

public setNodeClass(string $type, string $class) : $this
Parameters
$type : string

The name of the type

$class : string

The fully qualified name the node definition class

Return values
$this

getNodeClass()

Returns the class name of the node definition.

protected getNodeClass(string $type) : string
Parameters
$type : string
Tags
throws
RuntimeException

When the node type is not registered

throws
RuntimeException

When the node class is not found

Return values
string

        
On this page

Search results