Mage_Core_Model_Config_Element
extends Element
in package
Table of Contents
Properties
Methods
- appendChild() : Element
- Appends $source to current node
- asArray() : array<string|int, mixed>
- Returns the node and children as an array
- asCanonicalArray() : array<string|int, mixed>|string
- asArray() analog, but without attributes
- asNiceXml() : string
- Makes nicely formatted XML from the node
- descend() : Element|false
- Find a descendant of a node by path
- extend() : Element
- Extends current node with xml from $source
- extendChild() : Element
- Extends one node
- getAttribute() : string
- Returns attribute value by attribute name
- getClassName() : false|string
- getParent() : Element
- Returns parent node for the element
- hasChildren() : bool
- innerXml() : string
- is() : bool
- setNode() : mixed
- setParent() : void
- For future use
- xmlentities() : string
- Converts meaningful xml characters to xml entities
- _asArray() : array<string|int, mixed>|string
- Returns the node and children as an array
Properties
$_parent
Would keep reference to parent node
protected
Element
$_parent
= null
If SimpleXMLElement would support complicated attributes
Tags
Methods
appendChild()
Appends $source to current node
public
appendChild(Element $source) : Element
Parameters
- $source : Element
Return values
ElementasArray()
Returns the node and children as an array
public
asArray() : array<string|int, mixed>
Return values
array<string|int, mixed>asCanonicalArray()
asArray() analog, but without attributes
public
asCanonicalArray() : array<string|int, mixed>|string
Return values
array<string|int, mixed>|stringasNiceXml()
Makes nicely formatted XML from the node
public
asNiceXml([string $filename = '' ][, int|bool $level = 0 ]) : string
Parameters
- $filename : string = ''
- $level : int|bool = 0
-
if false
Return values
stringdescend()
Find a descendant of a node by path
public
descend(array<string|int, mixed>|string $path) : Element|false
Parameters
- $path : array<string|int, mixed>|string
-
Example: "child/grand@attrName=attrValue/subGrand" (to make it faster without regex)
Tags
Return values
Element|falseextend()
Extends current node with xml from $source
public
extend(Element $source[, bool $overwrite = false ]) : Element
If $overwrite is false will merge only missing nodes Otherwise will overwrite existing nodes
Parameters
- $source : Element
- $overwrite : bool = false
Return values
ElementextendChild()
Extends one node
public
extendChild(Element $source[, bool $overwrite = false ]) : Element
Parameters
- $source : Element
- $overwrite : bool = false
Return values
ElementgetAttribute()
Returns attribute value by attribute name
public
getAttribute(mixed $name) : string
Parameters
- $name : mixed
Return values
stringgetClassName()
public
getClassName() : false|string
Return values
false|stringgetParent()
Returns parent node for the element
public
getParent() : Element
Currently using xpath
Return values
ElementhasChildren()
public
hasChildren() : bool
Attributes
- #[Override]
- #[ReturnTypeWillChange]
Return values
boolinnerXml()
public
innerXml([int $level = 0 ]) : string
Parameters
- $level : int = 0
Return values
stringis()
public
is(string $var[, string|true $value = true ]) : bool
Parameters
- $var : string
- $value : string|true = true
Return values
boolsetNode()
public
setNode(mixed $path, mixed $value[, mixed $overwrite = true ]) : mixed
Parameters
- $path : mixed
- $value : mixed
- $overwrite : mixed = true
setParent()
For future use
public
setParent(Element $element) : void
Parameters
- $element : Element
xmlentities()
Converts meaningful xml characters to xml entities
public
xmlentities([string $value = null ]) : string
Parameters
- $value : string = null
Return values
string_asArray()
Returns the node and children as an array
protected
_asArray([bool $isCanonical = false ]) : array<string|int, mixed>|string
Parameters
- $isCanonical : bool = false
-
- whether to ignore attributes