abstract class NodeDefinition implements NodeParentInterface
This class provides a fluent interface for defining a node.
Methods
|
__construct(string $name, NodeParentInterface $parent = null)
Constructor |
||
| NodeDefinition |
setParent(NodeParentInterface $parent)
Sets the parent node. |
|
| NodeDefinition |
info(string $info)
Sets info message. |
|
| NodeDefinition |
example(string|array $example)
Sets example configuration. |
|
| NodeDefinition |
attribute(string $key, mixed $value)
Sets an attribute on the node. |
|
| NodeParentInterface |
end()
Returns the parent node. |
|
| NodeInterface |
getNode(Boolean $forceRootNode = false)
Creates the node. |
|
| NodeDefinition |
defaultValue(mixed $value)
Sets the default value. |
|
| NodeDefinition |
isRequired()
Sets the node as required. |
|
| NodeDefinition |
treatNullLike(mixed $value)
Sets the equivalent value used when the node contains null. |
|
| NodeDefinition |
treatTrueLike(mixed $value)
Sets the equivalent value used when the node contains true. |
|
| NodeDefinition |
treatFalseLike(mixed $value)
Sets the equivalent value used when the node contains false. |
|
| NodeDefinition |
defaultNull()
Sets null as the default value. |
|
| NodeDefinition |
defaultTrue()
Sets true as the default value. |
|
| NodeDefinition |
defaultFalse()
Sets false as the default value. |
|
| ExprBuilder |
beforeNormalization()
Sets an expression to run before the normalization. |
|
| NodeDefinition |
cannotBeEmpty()
Denies the node value being empty. |
|
| ExprBuilder |
validate()
Sets an expression to run for the validation. |
|
| NodeDefinition |
cannotBeOverwritten(Boolean $deny = true)
Sets whether the node can be overwritten. |
Details
at line 47
public
__construct(string $name, NodeParentInterface $parent = null)
Constructor
at line 64
public NodeDefinition
setParent(NodeParentInterface $parent)
Sets the parent node.
at line 78
public NodeDefinition
info(string $info)
Sets info message.
at line 90
public NodeDefinition
example(string|array $example)
Sets example configuration.
at line 103
public NodeDefinition
attribute(string $key, mixed $value)
Sets an attribute on the node.
at line 115
public NodeParentInterface
end()
Returns the parent node.
at line 127
public NodeInterface
getNode(Boolean $forceRootNode = false)
Creates the node.
at line 154
public NodeDefinition
defaultValue(mixed $value)
Sets the default value.
at line 167
public NodeDefinition
isRequired()
Sets the node as required.
at line 181
public NodeDefinition
treatNullLike(mixed $value)
Sets the equivalent value used when the node contains null.
at line 195
public NodeDefinition
treatTrueLike(mixed $value)
Sets the equivalent value used when the node contains true.
at line 209
public NodeDefinition
treatFalseLike(mixed $value)
Sets the equivalent value used when the node contains false.
at line 221
public NodeDefinition
defaultNull()
Sets null as the default value.
at line 231
public NodeDefinition
defaultTrue()
Sets true as the default value.
at line 241
public NodeDefinition
defaultFalse()
Sets false as the default value.
at line 251
public ExprBuilder
beforeNormalization()
Sets an expression to run before the normalization.
at line 261
public NodeDefinition
cannotBeEmpty()
Denies the node value being empty.
at line 277
public ExprBuilder
validate()
Sets an expression to run for the validation.
The expression receives the value of the node and must return it. It can
modify it.
An exception should be thrown when the node is not valid.
at line 289
public NodeDefinition
cannotBeOverwritten(Boolean $deny = true)
Sets whether the node can be overwritten.