Feed/Abstract.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 [email protected] so we can send you a copy immediately.
Category
Zend  
Copyright
Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  
Package
Zend_Feed  
Version
$Id$  

\Zend_Feed_Abstract

Package: Zend_Feed
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.
Implements
Parent(s)
\Zend_Feed_Element
Children
\Zend_Feed_Rss
\Zend_Feed_Atom
Category
Zend  
Copyright
Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  

Properties

>VPropertyprotectedarray $_entries
Cache of feed entries.
Details
Type
array
>VPropertyprotectedinteger $_entryIndex = 0
Current index on the collection of feed entries for the Iterator implementation.
Default value0Details
Type
integer

Methods

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
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__sleep() : array

Prepare for serialiation

Returns
TypeDescription
array
methodpublic__wakeup() : void

Load the feed as an XML DOMDocument object

Throws
ExceptionDescription
\Zend_Feed_Exception
methodprotected_buildEntryCache() : void

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

methodprotected_importFeedFromString(string $feed) : string

Import a feed from a string

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) : \DOMElement
abstract

Generate the entries of the feed when working in write mode

Parameters
NameTypeDescription
$root\DOMElement

the root node to use

$arrayarray

the data to use

Returns
TypeDescription
\DOMElementroot node
methodprotected_mapFeedHeaders(array $array) : \DOMElement
abstract

Generate the header of the feed when working in write mode

Parameters
NameTypeDescription
$arrayarray

the data to use

Returns
TypeDescription
\DOMElementroot node
methodpubliccount() : integer

Get the number of entries in this feed object.

Returns
TypeDescription
integerEntry count.
methodpubliccurrent() : mixed

Required by the Iterator interface.

Returns
TypeDescription
mixedThe current row, or null if no rows.
methodpublickey() : mixed

Required by the Iterator interface.

Returns
TypeDescription
mixedThe current row number (starts at 0), or NULL if no rows
methodpublicnext() : mixed

Required by the Iterator interface.

Returns
TypeDescription
mixedThe next row, or null if no more rows.
methodpublicrewind() : void

Required by the Iterator interface.

methodpublicsend() : void
abstract

Send feed to a http client with the correct header

Throws
ExceptionDescription
\Zend_Feed_Exceptionif headers have already been sent
methodpublicvalid() : boolean

Required by the Iterator interface.

Returns
TypeDescription
booleanWhether the iteration is valid
Documentation was generated by phpDocumentor 2.2.0 .