API Documentation

Feed/Abstract.php

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-2011 Zend Technologies USA Inc. (http://www.zend.com)  
license
New BSD License  
package
Zend_Feed  
version
$Id: Abstract.php 23775 2011-03-01 17:25:24Z ralph $  

\Zend_Feed_Abstract

The Zend_Feed_Abstract class is an abstract class representing feeds.

Zend_Feed_Abstract implements two core PHP 5 interfaces: ArrayAccess and Iterator. In both cases the collection being treated as an array is considered to be the entry collection, such that iterating over the feed takes you through each of the feed.s entries.

Extends from
\Zend_Feed_Element
Implements
category
Zend  
copyright
Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)  
license
New BSD License  
package
Zend_Feed  

Properties

Propertyprotectedarray  $_entries= ''

Cache of feed entries.

Details
Type
array
Propertyprotectedinteger  $_entryIndex= '0'

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

Default value0Details
Type
integer

Methods

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

Get the value of an element with method syntax.

Inherited from: \Zend_Feed_Element::__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
Name Type Description
$var string The element to get the string value of.
$unused mixed This parameter is not used.
Returns
Type Description
mixed The node's value, null, or an array of nodes.
methodpublic__construct( string $uri = null, string $string = null, \Zend_Feed_Builder_Interface $builder = null ) : void

Feed constructor

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

Parameters
Name Type Description
$uri string The full URI of the feed to load, or NULL if not retrieved via HTTP or as an array.
$string string 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
Exception Description
\Zend_Feed_Exception If loading the feed failed.
methodpublic__get( string $var ) : mixed

Map variable access onto the underlying entry representation.

Inherited from: \Zend_Feed_Element::__get()

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
Name Type Description
$var string The property to access.
Returns
Type Description
mixed
methodpublic__isset( string $var ) : boolean

Map isset calls onto the underlying entry representation.

Inherited from: \Zend_Feed_Element::__isset()
Parameters
Name Type Description
$var string
Returns
Type Description
boolean
methodpublic__set( string $var, string $val ) : void

Map variable sets onto the underlying entry representation.

Inherited from: \Zend_Feed_Element::__set()
Parameters
Name Type Description
$var string The property to change.
$val string

The property's new value.

Throws
Exception Description
\Zend_Feed_Exception
methodpublic__sleep( ) : array

Prepare for serialiation

Returns
Type Description
array
methodpublic__toString( ) : string

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

Inherited from: \Zend_Feed_Element::__toString()
Returns
Type Description
string
methodpublic__unset( string $var ) : void

Remove all children matching $var.

Inherited from: \Zend_Feed_Element::__unset()
Parameters
Name Type Description
$var string
methodpublic__wakeup( ) : void

Load the feed as an XML DOMDocument object

Throws
Exception Description
\Zend_Feed_Exception
methodprotected_buildEntryCache( ) : void

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

methodprotected_children( string $var ) : array

Finds children with tagnames matching $var

Inherited from: \Zend_Feed_Element::_children()

Similar to SimpleXML's children() method.

Parameters
Name Type Description
$var string Tagname to match, can be either namespace:tagName or just tagName.
Returns
Type Description
array
methodprotected_mapFeedEntries( \DOMElement $root, array $array ) : \DOMElement
abstract

Generate the entries of the feed when working in write mode

Parameters
Name Type Description
$root \DOMElement the root node to use
$array array the data to use
Returns
Type Description
\DOMElement root node
methodprotected_mapFeedHeaders( array $array ) : \DOMElement
abstract

Generate the header of the feed when working in write mode

Parameters
Name Type Description
$array array the data to use
Returns
Type Description
\DOMElement root node
methodpubliccount( ) : integer

Get the number of entries in this feed object.

Returns
Type Description
integer Entry count.
methodpubliccurrent( ) : mixed

Required by the Iterator interface.

Returns
Type Description
mixed The current row, or null if no rows.
methodprotectedensureAppended( ) : void

Appends this element to its parent if necessary.

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

Get a DOM representation of the element

Inherited from: \Zend_Feed_Element::getDOM()

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

Returns
Type Description
\DOMDocument
methodpublicgetEncoding( ) : string

Get encoding

Inherited from: \Zend_Feed_Element::getEncoding()
Returns
Type Description
string
methodpublickey( ) : mixed

Required by the Iterator interface.

Returns
Type Description
mixed The current row number (starts at 0), or NULL if no rows
methodpublicnext( ) : mixed

Required by the Iterator interface.

Returns
Type Description
mixed The next row, or null if no more rows.
methodpublicoffsetExists( string $offset ) : boolean

Required by the ArrayAccess interface.

Inherited from: \Zend_Feed_Element::offsetExists()
Parameters
Name Type Description
$offset string
Returns
Type Description
boolean
methodpublicoffsetGet( string $offset ) : string

Required by the ArrayAccess interface.

Inherited from: \Zend_Feed_Element::offsetGet()
Parameters
Name Type Description
$offset string
Returns
Type Description
string
methodpublicoffsetSet( string $offset, string $value ) : string

Required by the ArrayAccess interface.

Inherited from: \Zend_Feed_Element::offsetSet()
Parameters
Name Type Description
$offset string
$value string
Returns
Type Description
string
methodpublicoffsetUnset( string $offset ) : boolean

Required by the ArrayAccess interface.

Inherited from: \Zend_Feed_Element::offsetUnset()
Parameters
Name Type Description
$offset string
Returns
Type Description
boolean
methodpublicrewind( ) : void

Required by the Iterator interface.

methodpublicsaveXml( ) : string

Get an XML string representation of this element

Inherited from: \Zend_Feed_Element::saveXml()

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

Returns
Type Description
string
methodpublicsaveXmlFragment( ) : string

Get the XML for only this element

Inherited from: \Zend_Feed_Element::saveXmlFragment()

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

Returns
Type Description
string
methodpublicsend( ) : void
abstract

Send feed to a http client with the correct header

Throws
Exception Description
\Zend_Feed_Exception if headers have already been sent
methodpublicsetDOM( \DOMElement $element ) : void

Update the object from a DOM element

Inherited from: \Zend_Feed_Element::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
Name Type Description
$element \DOMElement
methodpublicsetEncoding( string $value ) : \Zend_Feed_Element

Set encoding

Inherited from: \Zend_Feed_Element::setEncoding()
Parameters
Name Type Description
$value string Encoding to use
Returns
Type Description
\Zend_Feed_Element
methodpublicsetParent( \Zend_Feed_Element $element ) : void

Set the parent element of this object to another Zend_Feed_Element.

Inherited from: \Zend_Feed_Element::setParent()
Parameters
Name Type Description
$element \Zend_Feed_Element
methodpublicvalid( ) : boolean

Required by the Iterator interface.

Returns
Type Description
boolean Whether the iteration is valid
Documentation was generated by DocBlox 0.13.3.