Atom feed class

The Zend_Feed_Atom class is a concrete subclass of the general Zend_Feed_Abstract class, tailored for representing an Atom feed. It shares all of the same methods with its abstract parent. The distinction is made in the format of data that Zend_Feed_Atom expects, and as a further pointer for users as to what kind of feed object they have been passed.

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

 Methods

Get the value of an element with method syntax.

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

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
Inherited

Parameters

$element

\DOMElement

The DOM element we're encapsulating.

Make accessing some individual elements of the feed easier.

__get(string $var) : mixed

Special accessors 'entry' and 'entries' are provided so that if you wish to iterate over an Atom feed's entries, you can do so using foreach ($feed->entries as $entry) or foreach ($feed->entry as $entry).

Parameters

$var

string

The property to access.

Returns

mixed

Map variable access onto the underlying entry representation.

__get(string $var) : mixed
Inherited

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
Inherited

Parameters

$var

string

Returns

boolean

Map variable sets onto the underlying entry representation.

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

Parameters

$var

string

The property to change.

$val

string

The property's new value.

Exceptions

\Zend_Feed_Exception

Prepare for serialiation

__sleep() : array
Inherited

Returns

array

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

__toString() : string
Inherited

Returns

string

Remove all children matching $var.

__unset(string $var) : void
Inherited

Parameters

$var

string

Override Zend_Feed_Abstract to set up the $_element and $_entries aliases.

__wakeup() : void
inherited_from \Zend_Feed_Abstract::__wakeup()

Exceptions

\Zend_Feed_Exception

Load the feed as an XML DOMDocument object

__wakeup() : void
Inherited

Exceptions

\Zend_Feed_Exception

Get the number of entries in this feed object.

count() : integer
Inherited

Returns

integerEntry count.

Required by the Iterator interface.

current() : mixed
Inherited

Returns

mixedThe current row, or null if no rows.

Get a DOM representation of the element

getDOM() : \DOMDocument
Inherited

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

Returns

\DOMDocument

Get encoding

getEncoding() : string
Inherited

Returns

string

Required by the Iterator interface.

key() : mixed
Inherited

Returns

mixedThe current row number (starts at 0), or NULL if no rows

Required by the Iterator interface.

next() : mixed
Inherited

Returns

mixedThe next row, or null if no more rows.

Required by the ArrayAccess interface.

offsetExists(string $offset) : boolean
Inherited

Parameters

$offset

string

Returns

boolean

Required by the ArrayAccess interface.

offsetGet(string $offset) : string
Inherited

Parameters

$offset

string

Returns

string

Required by the ArrayAccess interface.

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

Parameters

$offset

string

$value

string

Returns

string

Required by the ArrayAccess interface.

offsetUnset(string $offset) : boolean
Inherited

Parameters

$offset

string

Returns

boolean

Required by the Iterator interface.

rewind() : void
Inherited

Override Zend_Feed_Element to allow formated feeds

saveXml() : string

Returns

string

Get an XML string representation of this element

saveXml() : string
Inherited

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

Returns

string

Get the XML for only this element

saveXmlFragment() : string
Inherited

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

Returns

string

Send feed to a http client with the correct header

send() : void
inherited_from \Zend_Feed_Abstract::send()

Exceptions

\Zend_Feed_Exception if headers have already been sent

Send feed to a http client with the correct header

send() : void
Inherited

Exceptions

\Zend_Feed_Exception if headers have already been sent

Update the object from a DOM element

setDOM(\DOMElement $element) : void
Inherited

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
Inherited

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
Inherited

Parameters

$element

\Zend_Feed_Element

Required by the Iterator interface.

valid() : boolean
Inherited

Returns

booleanWhether the iteration is valid

Cache the individual feed elements so they don't need to be searched for on every operation.

_buildEntryCache() : void
Inherited

Finds children with tagnames matching $var

_children(string $var) : array
Inherited

Similar to SimpleXML's children() method.

Parameters

$var

string

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

Returns

array

Import a feed from a string

_importFeedFromString(string $feed) : string
Inherited

Protects against XXE attack vectors.

Parameters

$feed

string

Exceptions

\Zend_Feed_Exception on detection of an XXE vector

Returns

string

Generate the entries of the feed when working in write mode

_mapFeedEntries(\DOMElement $root, array $array) : void

The following nodes are constructed for each feed entry

url to feed entry entry title last update short text long version, can contain html
inherited_from \Zend_Feed_Abstract::_mapFeedEntries()

Parameters

$root

\DOMElement

the root node to use

$array

array

the data to use

Generate the entries of the feed when working in write mode

_mapFeedEntries(\DOMElement $root, array $array) : \DOMElement
Inherited

Parameters

$root

\DOMElement

the root node to use

$array

array

the data to use

Returns

\DOMElementroot node

Generate the header of the feed when working in write mode

_mapFeedHeaders(array $array) : \DOMElement
inherited_from \Zend_Feed_Abstract::_mapFeedHeaders()

Parameters

$array

array

the data to use

Returns

\DOMElementroot node

Generate the header of the feed when working in write mode

_mapFeedHeaders(array $array) : \DOMElement
Inherited

Parameters

$array

array

the data to use

Returns

\DOMElementroot node

Appends this element to its parent if necessary.

ensureAppended() : void
Inherited

 Properties

 

$_appended

$_appended : boolean

Default

true
 

The default namespace for Atom feeds.

$_defaultNamespace : string

Default

'atom'
 

$_element

$_element : \DOMElement

Default

 

Character encoding to utilize

$_encoding : string

Default

'UTF-8'
 

Cache of feed entries.

$_entries : array

Default

 

The classname for individual feed elements.

$_entryClassName : string

Default

'Zend_Feed_Entry_Atom'
 

The element name for individual feed elements (Atom <entry> elements).

$_entryElementName : string

Default

'entry'
 

Current index on the collection of feed entries for the Iterator implementation.

$_entryIndex : integer

Default

0
 

$_parentElement

$_parentElement : \Zend_Feed_Element

Default