Feed/Atom.php

Show: PublicProtectedPrivateinherited
Table of Contents
Zend Framework

LICENSE

This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to license@zend.com so we can send you a copy immediately.

Category
Zend  
Copyright
Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  
Package
Zend_Feed  
Version
$Id: Atom.php 24593 2012-01-05 20:35:02Z matthew $  

\Zend_Feed_Atom

Package: Zend\Feed
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.

Parent(s)
\Zend_Feed_Abstract < \Zend_Feed_Element
Category
Zend  
Copyright
Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  

Properties

>VPropertyprotectedboolean $_appended = true
Default valuetrueDetails
Type
boolean
Inherited_from
\Zend_Feed_Element::$$_appended  
Inherited_from
\Zend_Feed_Abstract::$$_appended  
>VPropertyprotectedstring $_defaultNamespace = 'atom'
The default namespace for Atom feeds.
Default value'atom'Details
Type
string
>VPropertyprotected\DOMElement $_element
>VPropertyprotectedstring $_encoding = 'UTF-8'
inherited

Character encoding to utilize

Inherited from: \Zend_Feed_Element::$$_encoding\Zend_Feed_Abstract::$$_encoding
Default value'UTF-8'Details
Type
string
Inherited_from
\Zend_Feed_Element::$$_encoding  
Inherited_from
\Zend_Feed_Abstract::$$_encoding  
>VPropertyprotectedarray $_entries
inherited
Cache of feed entries.
Inherited from: \Zend_Feed_Abstract::$$_entries
Details
Type
array
Inherited_from
\Zend_Feed_Abstract::$$_entries  
>VPropertyprotectedstring $_entryClassName = 'Zend_Feed_Entry_Atom'
The classname for individual feed elements.
Default value'Zend_Feed_Entry_Atom'Details
Type
string
>VPropertyprotectedstring $_entryElementName = 'entry'
The element name for individual feed elements (Atom elements).
Default value'entry'Details
Type
string
>VPropertyprotectedinteger $_entryIndex = 0
inherited
Current index on the collection of feed entries for the Iterator implementation.
Inherited from: \Zend_Feed_Abstract::$$_entryIndex
Default value0Details
Type
integer
Inherited_from
\Zend_Feed_Abstract::$$_entryIndex  

Methods

methodpublic__call(string $var, mixed $unused) : mixed
inherited

Get the value of an element with method syntax.

Inherited from: \Zend_Feed_Element::__call()\Zend_Feed_Abstract::__call()

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
NameTypeDescription
$varstring

The element to get the string value of.

$unusedmixed

This parameter is not used.

Returns
TypeDescription
mixedThe node's value, null, or an array of nodes.
methodpublic__construct(string $uri = null, string $string = null, \Zend_Feed_Builder_Interface $builder = null) : void
inherited

Feed constructor

Inherited from: \Zend_Feed_Abstract::__construct()

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

Parameters
NameTypeDescription
$uristring

The full URI of the feed to load, or NULL if not retrieved via HTTP or as an array.

$stringstring

The feed as a string, or NULL if retrieved via HTTP or as an array.

$builder\Zend_Feed_Builder_Interface

The feed as a builder instance or NULL if retrieved as a string or via HTTP.

Throws
ExceptionDescription
\Zend_Feed_ExceptionIf loading the feed failed.
methodpublic__get(string $var) : mixed

Make accessing some individual elements of the feed easier.

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
NameTypeDescription
$varstring

The property to access.

Returns
TypeDescription
mixed
methodpublic__isset(string $var) : boolean
inherited

Map isset calls onto the underlying entry representation.

Inherited from: \Zend_Feed_Element::__isset()\Zend_Feed_Abstract::__isset()
Parameters
NameTypeDescription
$varstring
Returns
TypeDescription
boolean
methodpublic__set(string $var, string $val) : void
inherited

Map variable sets onto the underlying entry representation.

Inherited from: \Zend_Feed_Element::__set()\Zend_Feed_Abstract::__set()
Parameters
NameTypeDescription
$varstring

The property to change.

$valstring

The property's new value.

Throws
ExceptionDescription
\Zend_Feed_Exception
methodpublic__sleep() : array
inherited

Prepare for serialiation

Inherited from: \Zend_Feed_Abstract::__sleep()
Returns
TypeDescription
array
methodpublic__toString() : string
inherited

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

Inherited from: \Zend_Feed_Element::__toString()\Zend_Feed_Abstract::__toString()
Returns
TypeDescription
string
methodpublic__unset(string $var) : void
inherited

Remove all children matching $var.

Inherited from: \Zend_Feed_Element::__unset()\Zend_Feed_Abstract::__unset()
Parameters
NameTypeDescription
$varstring
methodpublic__wakeup() : void

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

Throws
ExceptionDescription
\Zend_Feed_Exception
methodprotected_buildEntryCache() : void
inherited

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

Inherited from: \Zend_Feed_Abstract::_buildEntryCache()
methodprotected_children(string $var) : array
inherited

Finds children with tagnames matching $var

Inherited from: \Zend_Feed_Element::_children()\Zend_Feed_Abstract::_children()

Similar to SimpleXML's children() method.

Parameters
NameTypeDescription
$varstring

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

Returns
TypeDescription
array
methodprotected_importFeedFromString(string $feed) : string
inherited

Import a feed from a string

Inherited from: \Zend_Feed_Abstract::_importFeedFromString()

Protects against XXE attack vectors.

Parameters
NameTypeDescription
$feedstring
Returns
TypeDescription
string
Throws
ExceptionDescription
\Zend_Feed_Exceptionon detection of an XXE vector
methodprotected_mapFeedEntries(\DOMElement $root, array $array) : void

Generate the entries of the feed when working in write mode

The following nodes are constructed for each feed entry url to feed entry entry title last update

short text long version, can contain html

Parameters
NameTypeDescription
$root\DOMElement

the root node to use

$arrayarray

the data to use

methodprotected_mapFeedHeaders(array $array) : \DOMElement

Generate the header of the feed when working in write mode

Parameters
NameTypeDescription
$arrayarray

the data to use

Returns
TypeDescription
\DOMElementroot node
methodpubliccount() : integer
inherited

Get the number of entries in this feed object.

Inherited from: \Zend_Feed_Abstract::count()
Returns
TypeDescription
integerEntry count.
methodpubliccurrent() : mixed
inherited

Required by the Iterator interface.

Inherited from: \Zend_Feed_Abstract::current()
Returns
TypeDescription
mixedThe current row, or null if no rows.
methodprotectedensureAppended() : void
inherited

Appends this element to its parent if necessary.

Inherited from: \Zend_Feed_Element::ensureAppended()\Zend_Feed_Abstract::ensureAppended()
methodpublicgetDOM() : \DOMDocument
inherited

Get a DOM representation of the element

Inherited from: \Zend_Feed_Element::getDOM()\Zend_Feed_Abstract::getDOM()

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

Returns
TypeDescription
\DOMDocument
methodpublicgetEncoding() : string
Returns
TypeDescription
string
methodpublickey() : mixed
inherited

Required by the Iterator interface.

Inherited from: \Zend_Feed_Abstract::key()
Returns
TypeDescription
mixedThe current row number (starts at 0), or NULL if no rows
methodpubliclink(string $rel = null) : mixed

Easy access to tags keyed by "rel" attributes.

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.

Parameters
NameTypeDescription
$relstring

The "rel" attribute to look for.

Returns
TypeDescription
mixed
methodpublicnext() : mixed
inherited

Required by the Iterator interface.

Inherited from: \Zend_Feed_Abstract::next()
Returns
TypeDescription
mixedThe next row, or null if no more rows.
methodpublicoffsetExists(string $offset) : boolean
inherited

Required by the ArrayAccess interface.

Inherited from: \Zend_Feed_Element::offsetExists()\Zend_Feed_Abstract::offsetExists()
Parameters
NameTypeDescription
$offsetstring
Returns
TypeDescription
boolean
methodpublicoffsetGet(string $offset) : string
inherited

Required by the ArrayAccess interface.

Inherited from: \Zend_Feed_Element::offsetGet()\Zend_Feed_Abstract::offsetGet()
Parameters
NameTypeDescription
$offsetstring
Returns
TypeDescription
string
methodpublicoffsetSet(string $offset, string $value) : string
inherited

Required by the ArrayAccess interface.

Inherited from: \Zend_Feed_Element::offsetSet()\Zend_Feed_Abstract::offsetSet()
Parameters
NameTypeDescription
$offsetstring
$valuestring
Returns
TypeDescription
string
methodpublicoffsetUnset(string $offset) : boolean
inherited

Required by the ArrayAccess interface.

Inherited from: \Zend_Feed_Element::offsetUnset()\Zend_Feed_Abstract::offsetUnset()
Parameters
NameTypeDescription
$offsetstring
Returns
TypeDescription
boolean
methodpublicrewind() : void
inherited

Required by the Iterator interface.

Inherited from: \Zend_Feed_Abstract::rewind()
methodpublicsaveXml() : string

Override Zend_Feed_Element to allow formated feeds

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

Returns
TypeDescription
string
methodpublicsaveXmlFragment() : string
inherited

Get the XML for only this element

Inherited from: \Zend_Feed_Element::saveXmlFragment()\Zend_Feed_Abstract::saveXmlFragment()

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

Returns
TypeDescription
string
methodpublicsend() : void

Send feed to a http client with the correct header

Throws
ExceptionDescription
\Zend_Feed_Exceptionif headers have already been sent
methodpublicsetDOM(\DOMElement $element) : void
inherited

Update the object from a DOM element

Inherited from: \Zend_Feed_Element::setDOM()\Zend_Feed_Abstract::setDOM()

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
NameTypeDescription
$element\DOMElement
methodpublicsetEncoding(string $value) : \Zend_Feed_Element
Parameters
NameTypeDescription
$valuestring

Encoding to use

Returns
TypeDescription
\Zend_Feed_Element
methodpublicsetParent(\Zend_Feed_Element $element) : void
inherited

Set the parent element of this object to another Zend_Feed_Element.

Inherited from: \Zend_Feed_Element::setParent()\Zend_Feed_Abstract::setParent()
Parameters
NameTypeDescription
$element\Zend_Feed_Element
methodpublicvalid() : boolean
inherited

Required by the Iterator interface.

Inherited from: \Zend_Feed_Abstract::valid()
Returns
TypeDescription
booleanWhether the iteration is valid
Documentation was generated by phpDocumentor 2.0.0a12.