Wraps a DOMElement allowing for SimpleXML-like access to attributes.

category Zend
package Zend_Feed
copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
license New BSD License

 Methods

Get the value of an element with method syntax.

__call(string $var, mixed $unused) : mixed

Map method calls to get the string value of the requested element. If there are multiple elements that match, this will return an array of those objects.

Parameters

$var

string

The element to get the string value of.

$unused

mixed

This parameter is not used.

Returns

mixedThe node's value, null, or an array of nodes.

Zend_Feed_Element constructor.

__construct(\DOMElement $element = null) : void

Parameters

$element

\DOMElement

The DOM element we're encapsulating.

Map variable access onto the underlying entry representation.

__get(string $var) : mixed

Get-style access returns a Zend_Feed_Element representing the child element accessed. To get string values, use method syntax with the __call() overriding.

Parameters

$var

string

The property to access.

Returns

mixed

Map isset calls onto the underlying entry representation.

__isset(string $var) : boolean

Parameters

$var

string

Returns

boolean

Map variable sets onto the underlying entry representation.

__set(string $var, string $val) : void

Parameters

$var

string

The property to change.

$val

string

The property's new value.

Exceptions

\Zend_Feed_Exception

Returns the nodeValue of this element when this object is used in a string context.

__toString() : string

Returns

string

Remove all children matching $var.

__unset(string $var) : void

Parameters

$var

string

Get a DOM representation of the element

getDOM() : \DOMDocument

Returns the underlying DOM object, which can then be manipulated with full DOM methods.

Returns

\DOMDocument

Get encoding

getEncoding() : string

Returns

string

Required by the ArrayAccess interface.

offsetExists(string $offset) : boolean

Parameters

$offset

string

Returns

boolean

Required by the ArrayAccess interface.

offsetGet(string $offset) : string

Parameters

$offset

string

Returns

string

Required by the ArrayAccess interface.

offsetSet(string $offset, string $value) : string

Parameters

$offset

string

$value

string

Returns

string

Required by the ArrayAccess interface.

offsetUnset(string $offset) : boolean

Parameters

$offset

string

Returns

boolean

Get an XML string representation of this element

saveXml() : string

Returns a string of this element's XML, including the XML prologue.

Returns

string

Get the XML for only this element

saveXmlFragment() : string

Returns a string of this element's XML without prologue.

Returns

string

Update the object from a DOM element

setDOM(\DOMElement $element) : void

Take a DOMElement object, which may be originally from a call to getDOM() or may be custom created, and use it as the DOM tree for this Zend_Feed_Element.

Parameters

$element

\DOMElement

Set encoding

setEncoding(string $value) : \Zend_Feed_Element

Parameters

$value

string

Encoding to use

Returns

\Zend_Feed_Element

Set the parent element of this object to another Zend_Feed_Element.

setParent(\Zend_Feed_Element $element) : void

Parameters

$element

\Zend_Feed_Element

Finds children with tagnames matching $var

_children(string $var) : array

Similar to SimpleXML's children() method.

Parameters

$var

string

Tagname to match, can be either namespace:tagName or just tagName.

Returns

array

Appends this element to its parent if necessary.

ensureAppended() : void

 Properties

 

$_appended

$_appended : boolean

Default

true
 

$_element

$_element : \DOMElement

Default

 

Character encoding to utilize

$_encoding : string

Default

'UTF-8'
 

$_parentElement

$_parentElement : \Zend_Feed_Element

Default