Documentation

Horde_Feed_Atom extends Horde_Feed_Base

Atom feed class

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

Tags
author

Chuck Hagenbuch chuck@horde.org

category

Horde

copyright

2005-2007 Zend Technologies USA Inc.

copyright

2007-2017 Horde LLC

license

http://www.horde.org/licenses/bsd BSD

Table of Contents

$_defaultNamespace  : string
The default namespace for Atom feeds.
$_emptyXml  : string
The XML string for an "empty" Atom feed.
$_httpClient  : Horde_Http_Client
$_listItemClassName  : string
The classname for individual feed elements.
$_uri  : string
Our root ("home") URI
__construct()  : mixed
Feed constructor
__wakeup()  : mixed
Handle null or array values for $this->_element by initializing with $this->_emptyXml, and importing the array with Horde_Xml_Element::fromArray() if necessary.
link()  : mixed
Easy access to <link> tags keyed by "rel" attributes.
_buildListItemCache()  : array<string|int, mixed>
Cache the individual feed elements so they don't need to be searched for on every operation.

Properties

$_defaultNamespace

The default namespace for Atom feeds.

protected string $_defaultNamespace = 'atom'

$_emptyXml

The XML string for an "empty" Atom feed.

protected string $_emptyXml = '<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom"></feed>'

$_httpClient

protected Horde_Http_Client $_httpClient

$_listItemClassName

The classname for individual feed elements.

protected string $_listItemClassName = 'Horde_Feed_Entry_Atom'

$_uri

Our root ("home") URI

protected string $_uri

Methods

__construct()

Feed constructor

public __construct([mixed $xml = null ][, string $uri = null ][, Horde_Http_Client $httpClient = null ]) : mixed

The Horde_Feed_Base constructor takes the URI of a feed or a feed represented as a string and loads it as XML.

Parameters
$xml : mixed = null

The feed as a string, a DOMElement, or null.

$uri : string = null

The full URI of the feed, or null if unknown.

$httpClient : Horde_Http_Client = null
Tags
throws
Horde_Feed_Exception

If loading the feed failed.

Return values
mixed

__wakeup()

Handle null or array values for $this->_element by initializing with $this->_emptyXml, and importing the array with Horde_Xml_Element::fromArray() if necessary.

public __wakeup() : mixed
Tags
see
Horde_Xml_Element::__wakeup
see
Horde_Xml_Element::fromArray
Return values
mixed

Easy access to <link> tags keyed by "rel" attributes.

public link([string $rel = null ]) : mixed
Parameters
$rel : string = null

The "rel" attribute to look for.

Tags
TODO

rationalize this with other __get/__call access

If $elt->link() is called with no arguments, we will attempt to return the value of the tag(s) like all other method-syntax attribute access. If an argument is passed to link(), however, then we will return the "href" value of the first tag that has a "rel" attribute matching $rel:

$elt->link(): returns the value of the link tag. $elt->link('self'): returns the href from the first in the entry.

Return values
mixed

_buildListItemCache()

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

protected _buildListItemCache() : array<string|int, mixed>
Return values
array<string|int, mixed>

Search results