Definition\ArrayNode (Component\Config)
Symfony\Component\Config\Definition\ArrayNode
class ArrayNode extends BaseNode implements PrototypeNodeInterface
Represents an Array node in the config tree.
Methods
__construct(string $name, NodeInterface $parent = null) Constructor. | from BaseNode | |
setAttribute($key, $value) | from BaseNode | |
getAttribute($key, $default = null) | from BaseNode | |
hasAttribute($key) | from BaseNode | |
getAttributes() | from BaseNode | |
setAttributes(array $attributes) | from BaseNode | |
removeAttribute($key) | from BaseNode | |
setInfo(string $info) Sets an info message. | from BaseNode | |
string | getInfo() Returns info message. | from BaseNode |
setExample(string|array $example) Sets the example configuration for this node. | from BaseNode | |
string|array | getExample() Retrieves the example configuration for this node. | from BaseNode |
addEquivalentValue(mixed $originalValue, mixed $equivalentValue) Adds an equivalent value. | from BaseNode | |
setRequired(bool $boolean) Set this node as required. | from BaseNode | |
setAllowOverwrite(bool $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 | |
bool | 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 |
NodeInterface|null | getParent() Returns parent node for this node. | from BaseNode |
mixed | finalize(mixed $value) Finalizes a value. | from BaseNode |
setNormalizeKeys($normalizeKeys) | ||
array | getChildren() Retrieves the children of this node. | |
setXmlRemappings(array $remappings) Sets the xml remappings that should be performed. | ||
array | getXmlRemappings() Gets the xml remappings that should be performed. | |
setAddIfNotSet(bool $boolean) Sets whether to add default values for this array if it has not been defined in any of the configuration files. | ||
setAllowFalse(bool $allow) Sets whether false is allowed as value indicating that the array should be unset. | ||
setAllowNewKeys(bool $allow) Sets whether new keys can be defined in subsequent configurations. | ||
setPerformDeepMerging(bool $boolean) Sets if deep merging should occur. | ||
setIgnoreExtraKeys(bool $boolean, bool $remove = true) Whether extra keys should just be ignore without an exception. | ||
setName(string $name) Sets the node Name. | ||
bool | hasDefaultValue() Checks if the node has a default value. | |
array | getDefaultValue() Retrieves the default value. | |
addChild(NodeInterface $node) Adds a child node. |
Details
public __construct(string $name, NodeInterface $parent = null)
Constructor.
public setAttribute($key, $value)
public getAttribute($key, $default = null)
public hasAttribute($key)
public getAttributes()
public setAttributes(array $attributes)
public removeAttribute($key)
public setInfo(string $info)
Sets an info message.
public string getInfo()
Returns info message.
public setExample(string|array $example)
Sets the example configuration for this node.
public string|array getExample()
Retrieves the example configuration for this node.
public addEquivalentValue(mixed $originalValue, mixed $equivalentValue)
Adds an equivalent value.
public setRequired(bool $boolean)
Set this node as required.
public setAllowOverwrite(bool $allow)
Sets if this node can be overridden.
public setNormalizationClosures(array $closures)
Sets the closures used for normalization.
public setFinalValidationClosures(array $closures)
Sets the closures used for final validation.
public bool isRequired()
Returns true when the node is required.
public string getName()
Returns the name of the node.
public string getPath()
Returns the path of the node.
final public mixed merge(mixed $leftSide, mixed $rightSide)
Merges two values together.
final public mixed normalize(mixed $value)
Normalizes the supplied value.
public NodeInterface|null getParent()
Returns parent node for this node.
final public mixed finalize(mixed $value)
Finalizes a value.
public setNormalizeKeys($normalizeKeys)
public array getChildren()
Retrieves the children of this node.
public setXmlRemappings(array $remappings)
Sets the xml remappings that should be performed.
public array getXmlRemappings()
Gets the xml remappings that should be performed.
public setAddIfNotSet(bool $boolean)
Sets whether to add default values for this array if it has not been defined in any of the configuration files.
public setAllowFalse(bool $allow)
Sets whether false is allowed as value indicating that the array should be unset.
public setAllowNewKeys(bool $allow)
Sets whether new keys can be defined in subsequent configurations.
public setPerformDeepMerging(bool $boolean)
Sets if deep merging should occur.
public setIgnoreExtraKeys(bool $boolean, bool $remove = true)
Whether extra keys should just be ignore without an exception.
public setName(string $name)
Sets the node Name.
public bool hasDefaultValue()
Checks if the node has a default value.
public array getDefaultValue()
Retrieves the default value.
public addChild(NodeInterface $node)
Adds a child node.
© 2004–2016 Fabien Potencier
Licensed under the MIT License.
http://api.symfony.com/3.0/Symfony/Component/Config/Definition/ArrayNode.html