Documentation

Mage_Core_Model_Config_Element extends Element
in package

Table of Contents

Properties

$_parent  : Element
Would keep reference to parent node

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
todo

make use of spl_object_hash to keep global array of simplexml elements to emulate complicated attributes

Methods

asArray()

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>|string

asNiceXml()

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
string

descend()

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
todo

Do we need to make it xpath look-a-like?

Check if we still need all this and revert to plain XPath if this makes any sense

param string $path Subset of xpath. Example: "child/grand[@attrName='attrValue']/subGrand"

Return values
Element|false

extend()

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
Element

extendChild()

Extends one node

public extendChild(Element $source[, bool $overwrite = false ]) : Element
Parameters
$source : Element
$overwrite : bool = false
Return values
Element

getAttribute()

Returns attribute value by attribute name

public getAttribute(mixed $name) : string
Parameters
$name : mixed
Return values
string

getClassName()

public getClassName() : false|string
Return values
false|string

getParent()

Returns parent node for the element

public getParent() : Element

Currently using xpath

Return values
Element

hasChildren()

public hasChildren() : bool
Attributes
#[Override]
#[ReturnTypeWillChange]
Return values
bool

innerXml()

public innerXml([int $level = 0 ]) : string
Parameters
$level : int = 0
Return values
string

is()

public is(string $var[, string|true $value = true ]) : bool
Parameters
$var : string
$value : string|true = true
Return values
bool

setNode()

public setNode(mixed $path, mixed $value[, mixed $overwrite = true ]) : mixed
Parameters
$path : mixed
$value : mixed
$overwrite : mixed = true

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
Return values
array<string|int, mixed>|string
On this page

Search results