Symfony2 API
Class

Symfony\Component\Config\Definition\VariableNode

class VariableNode extends BaseNode implements PrototypeNodeInterface

This node represents a value of variable type in the config tree.

This node is intended for values of arbitrary type.
Any PHP type is accepted as a value.

Methods

__construct(string $name, NodeInterface $parent = null)

Constructor.

from BaseNode
addEquivalentValue(mixed $originalValue, mixed $equivalentValue)

Adds an equivalent value.

from BaseNode
setRequired(Boolean $boolean)

Set this node as required.

from BaseNode
setAllowOverwrite(Boolean $allow)

Sets if this node can be overridden.

from BaseNode
setNormalizationClosures(array $closures)

Sets the closures used for normalization.

from BaseNode
setFinalValidationClosures(array $closures)

Sets the closures used for final validation.

from BaseNode
Boolean isRequired()

Returns true when the node is required.

from BaseNode
string getName()

Returns the name of the node.

from BaseNode
string getPath()

Returns the path of the node.

from BaseNode
mixed merge(mixed $leftSide, mixed $rightSide)

Merges two values together.

from BaseNode
mixed normalize(mixed $value)

Normalizes the supplied value.

from BaseNode
mixed finalize(mixed $value)

Finalizes a value.

from BaseNode
setDefaultValue($value)

{@inheritDoc}

Boolean hasDefaultValue()

Returns true when the node has a default value.

mixed getDefaultValue()

Returns the default value of the node.

setAllowEmptyValue(Boolean $boolean)

Sets if this node is allowed to have an empty value.

setName(string $name)

Sets the name of the node.

Details

in BaseNode at line 41
public __construct(string $name, NodeInterface $parent = null)

Constructor.

Parameters

string $name The name of the node
NodeInterface $parent The parent of this node

Exceptions

InvalidArgumentException if the name contains a period.

in BaseNode at line 62
public addEquivalentValue(mixed $originalValue, mixed $equivalentValue)

Adds an equivalent value.

Parameters

mixed $originalValue
mixed $equivalentValue

in BaseNode at line 72
public setRequired(Boolean $boolean)

Set this node as required.

Parameters

Boolean $boolean Required node

in BaseNode at line 82
public setAllowOverwrite(Boolean $allow)

Sets if this node can be overridden.

Parameters

Boolean $allow

in BaseNode at line 92
public setNormalizationClosures(array $closures)

Sets the closures used for normalization.

Parameters

array $closures An array of Closures used for normalization

in BaseNode at line 102
public setFinalValidationClosures(array $closures)

Sets the closures used for final validation.

Parameters

array $closures An array of Closures used for final validation

in BaseNode at line 112
public Boolean isRequired()

Returns true when the node is required.

Return Value

Boolean If the node is required

in BaseNode at line 122
public string getName()

Returns the name of the node.

Return Value

string The Node's name.

in BaseNode at line 132
public string getPath()

Returns the path of the node.

Return Value

string The Node's path

in BaseNode at line 153
final public mixed merge(mixed $leftSide, mixed $rightSide)

Merges two values together.

Parameters

mixed $leftSide
mixed $rightSide

Return Value

mixed The merged value

in BaseNode at line 177
final public mixed normalize(mixed $value)

Normalizes the supplied value.

Parameters

mixed $value Value to normalize.

Return Value

mixed The normalized value.

in BaseNode at line 205
final public mixed finalize(mixed $value)

Finalizes a value.

Parameters

mixed $value The value to finalize

Return Value

mixed The finalized value

at line 33
public setDefaultValue($value)

{@inheritDoc}

Parameters

$value

at line 42
public Boolean hasDefaultValue()

Returns true when the node has a default value.

Return Value

Boolean If the node has a default value

at line 50
public mixed getDefaultValue()

Returns the default value of the node.

Return Value

mixed The default value

Exceptions

RuntimeException if the node has no default value

at line 60
public setAllowEmptyValue(Boolean $boolean)

Sets if this node is allowed to have an empty value.

Parameters

Boolean $boolean True if this entity will accept empty values.

at line 68
public setName(string $name)

Sets the name of the node.

Parameters

string $name The name of the node