Definition\Builder\IntegerNodeDefinition (Component\Config)
Symfony\Component\Config\Definition\Builder\IntegerNodeDefinition
class IntegerNodeDefinition extends NumericNodeDefinition
This class provides a fluent interface for defining an integer node.
Methods
__construct(string $name, NodeParentInterface $parent = null) Constructor | from NodeDefinition | |
NodeDefinition | setParent(NodeParentInterface $parent) Sets the parent node. | from NodeDefinition |
NodeDefinition | info(string $info) Sets info message. | from NodeDefinition |
NodeDefinition | example(string|array $example) Sets example configuration. | from NodeDefinition |
NodeDefinition | attribute(string $key, mixed $value) Sets an attribute on the node. | from NodeDefinition |
NodeParentInterface | end() Returns the parent node. | from NodeDefinition |
NodeInterface | getNode(Boolean $forceRootNode = false) Creates the node. | from NodeDefinition |
NodeDefinition | defaultValue(mixed $value) Sets the default value. | from NodeDefinition |
NodeDefinition | isRequired() Sets the node as required. | from NodeDefinition |
NodeDefinition | treatNullLike(mixed $value) Sets the equivalent value used when the node contains null. | from NodeDefinition |
NodeDefinition | treatTrueLike(mixed $value) Sets the equivalent value used when the node contains true. | from NodeDefinition |
NodeDefinition | treatFalseLike(mixed $value) Sets the equivalent value used when the node contains false. | from NodeDefinition |
NodeDefinition | defaultNull() Sets null as the default value. | from NodeDefinition |
NodeDefinition | defaultTrue() Sets true as the default value. | from NodeDefinition |
NodeDefinition | defaultFalse() Sets false as the default value. | from NodeDefinition |
ExprBuilder | beforeNormalization() Sets an expression to run before the normalization. | from NodeDefinition |
NodeDefinition | cannotBeEmpty() Denies the node value being empty. | from NodeDefinition |
ExprBuilder | validate() Sets an expression to run for the validation. | from NodeDefinition |
NodeDefinition | cannotBeOverwritten(Boolean $deny = true) Sets whether the node can be overwritten. | from NodeDefinition |
NumericNodeDefinition | max(mixed $max) Ensures that the value is smaller than the given reference. | from NumericNodeDefinition |
NumericNodeDefinition | min(mixed $min) Ensures that the value is bigger than the given reference. | from NumericNodeDefinition |
Details
public __construct(string $name, NodeParentInterface $parent = null)
Constructor
public NodeDefinition setParent(NodeParentInterface $parent)
Sets the parent node.
public NodeDefinition info(string $info)
Sets info message.
public NodeDefinition example(string|array $example)
Sets example configuration.
public NodeDefinition attribute(string $key, mixed $value)
Sets an attribute on the node.
public NodeParentInterface end()
Returns the parent node.
public NodeInterface getNode(Boolean $forceRootNode = false)
Creates the node.
public NodeDefinition defaultValue(mixed $value)
Sets the default value.
public NodeDefinition isRequired()
Sets the node as required.
public NodeDefinition treatNullLike(mixed $value)
Sets the equivalent value used when the node contains null.
public NodeDefinition treatTrueLike(mixed $value)
Sets the equivalent value used when the node contains true.
public NodeDefinition treatFalseLike(mixed $value)
Sets the equivalent value used when the node contains false.
public NodeDefinition defaultNull()
Sets null as the default value.
public NodeDefinition defaultTrue()
Sets true as the default value.
public NodeDefinition defaultFalse()
Sets false as the default value.
public ExprBuilder beforeNormalization()
Sets an expression to run before the normalization.
public NodeDefinition cannotBeEmpty()
Denies the node value being empty.
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.
public NodeDefinition cannotBeOverwritten(Boolean $deny = true)
Sets whether the node can be overwritten.
public NumericNodeDefinition max(mixed $max)
Ensures that the value is smaller than the given reference.
public NumericNodeDefinition min(mixed $min)
Ensures that the value is bigger than the given reference.
© 2004–2016 Fabien Potencier
Licensed under the MIT License.
http://api.symfony.com/3.0/Symfony/Component/Config/Definition/Builder/IntegerNodeDefinition.html