Feed/Writer/Feed.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 [email protected] 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_Writer
- Version
- $Id: Feed.php 24593 2012-01-05 20:35:02Z matthew $
\Zend_Feed_Writer_Feed
- Implements
- Parent(s)
- \Zend_Feed_Writer_Feed_FeedAbstract
- Category
- Zend
- Copyright
- Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
Properties


array $_data = array()
Contains all Feed level date to append in feed output
Inherited from: \Zend_Feed_Writer_Feed_FeedAbstract::$$_dataarray()
Details- Type
- array
- Inherited_from
- \Zend_Feed_Writer_Feed_FeedAbstract::$$_data


int $_entriesKey = 0
A pointer for the iterator to keep track of the entries array
0
Details- Type
- int


string $_type = null
Holds the value "atom" or "rss" depending on the feed type set when when last exported.
Inherited from: \Zend_Feed_Writer_Feed_FeedAbstract::$$_typenull
Details- Type
- string
- Inherited_from
- \Zend_Feed_Writer_Feed_FeedAbstract::$$_type
Methods


__call(string $method, array $args) : mixed
Method overloading: call given method on first extension implementing it
Inherited from: \Zend_Feed_Writer_Feed_FeedAbstract::__call()Name | Type | Description |
---|---|---|
$method | string | |
$args | array |
Type | Description |
---|---|
mixed |
Exception | Description |
---|---|
\Zend_Feed_Exception | if no extensions implements the method |


__construct() : void
Constructor: Primarily triggers the registration of core extensions and loads those appropriate to this data container.
Inherited from: \Zend_Feed_Writer_Feed_FeedAbstract::__construct()

_loadExtensions() : void
Load extensions from Zend_Feed_Writer
Inherited from: \Zend_Feed_Writer_Feed_FeedAbstract::_loadExtensions()

_validateTagUri(string $id) : bool
Validate a URI using the tag scheme (RFC 4151)
Inherited from: \Zend_Feed_Writer_Feed_FeedAbstract::_validateTagUri()Name | Type | Description |
---|---|---|
$id | string |
Type | Description |
---|---|
bool |


addAuthor( $name, $email = null, $uri = null) : string | null
Name | Type | Description |
---|---|---|
$name | ||
$uri |
Type | Description |
---|---|
string | null |


addAuthors( $authors) : array
Set an array with feed authors
Inherited from: \Zend_Feed_Writer_Feed_FeedAbstract::addAuthors()Name | Type | Description |
---|---|---|
$authors |
Type | Description |
---|---|
array |


addCategories(array $categories) : void
Set an array of feed categories
Inherited from: \Zend_Feed_Writer_Feed_FeedAbstract::addCategories()Name | Type | Description |
---|---|---|
$categories | array |


addEntry(\Zend_Feed_Writer_Entry $entry) : void
Appends a Zend_Feed_Writer_Entry object representing a new entry/item the feed data container's internal group of entries.
Name | Type | Description |
---|---|---|
$entry | \Zend_Feed_Writer_Entry |


addHub(string $url) : void
Add a Pubsubhubbub hub endpoint URL
Inherited from: \Zend_Feed_Writer_Feed_FeedAbstract::addHub()Name | Type | Description |
---|---|---|
$url | string |


addHubs(array $urls) : void
Add Pubsubhubbub hub endpoint URLs
Inherited from: \Zend_Feed_Writer_Feed_FeedAbstract::addHubs()Name | Type | Description |
---|---|---|
$urls | array |


addTombstone( $deleted) : void
Appends a Zend_Feed_Writer_Deleted object representing a new entry tombstone to the feed data container's internal group of entries.
Name | Type | Description |
---|---|---|
$deleted |


count() : int
Get the number of feed entries.
Required by the Iterator interface.
Type | Description |
---|---|
int |


createEntry() : \Zend_Feed_Writer_Entry
Creates a new Zend_Feed_Writer_Entry data container for use.
This is NOT added to the current feed automatically, but is necessary to create a container with some initial values preset based on the current feed data.
Type | Description |
---|---|
\Zend_Feed_Writer_Entry |


createTombstone() : \Zend_Feed_Writer_Deleted
Creates a new Zend_Feed_Writer_Deleted data container for use.
This is NOT added to the current feed automatically, but is necessary to create a container with some initial values preset based on the current feed data.
Type | Description |
---|---|
\Zend_Feed_Writer_Deleted |


current() : \Zend_Feed_Reader_Entry_Interface
Return the current entry
Type | Description |
---|---|
\Zend_Feed_Reader_Entry_Interface |


export(string $type, bool $ignoreExceptions = false) : string
Attempt to build and return the feed resulting from the data set
Name | Type | Description |
---|---|---|
$type | string | The feed type "rss" or "atom" to export as |
$ignoreExceptions | bool |
Type | Description |
---|---|
string |


getAuthor(int $index = 0) : string | null
Name | Type | Description |
---|---|---|
$index | int |
Type | Description |
---|---|
string | null |


getAuthors() : array
Get an array with feed authors
Inherited from: \Zend_Feed_Writer_Feed_FeedAbstract::getAuthors()Type | Description |
---|---|
array |


getCategories() : string | null
Get the feed categories
Inherited from: \Zend_Feed_Writer_Feed_FeedAbstract::getCategories()Type | Description |
---|---|
string | null |


getCopyright() : string | null
Get the copyright entry
Inherited from: \Zend_Feed_Writer_Feed_FeedAbstract::getCopyright()Type | Description |
---|---|
string | null |


getDateCreated() : string | null
Get the feed creation date
Inherited from: \Zend_Feed_Writer_Feed_FeedAbstract::getDateCreated()Type | Description |
---|---|
string | null |


getDateModified() : string | null
Get the feed modification date
Inherited from: \Zend_Feed_Writer_Feed_FeedAbstract::getDateModified()Type | Description |
---|---|
string | null |


getDescription() : string | null
Get the feed description
Inherited from: \Zend_Feed_Writer_Feed_FeedAbstract::getDescription()Type | Description |
---|---|
string | null |


getEncoding() : string | null
Get the feed character encoding
Inherited from: \Zend_Feed_Writer_Feed_FeedAbstract::getEncoding()Type | Description |
---|---|
string | null |


getEntry(int $index = 0) : void
Retrieve a specific indexed entry from the internal queue.
Entries must be added to a feed container in order to be indexed.
Name | Type | Description |
---|---|---|
$index | int |


getFeedLinks() : string | null
Get a link to the XML feed
Inherited from: \Zend_Feed_Writer_Feed_FeedAbstract::getFeedLinks()Type | Description |
---|---|
string | null |


getGenerator() : string | null
Get the feed generator entry
Inherited from: \Zend_Feed_Writer_Feed_FeedAbstract::getGenerator()Type | Description |
---|---|
string | null |


getHubs() : string | null
Get the URLs used as Pubsubhubbub hubs endpoints
Inherited from: \Zend_Feed_Writer_Feed_FeedAbstract::getHubs()Type | Description |
---|---|
string | null |


getLastBuildDate() : string | null
Get the feed last-build date
Inherited from: \Zend_Feed_Writer_Feed_FeedAbstract::getLastBuildDate()Type | Description |
---|---|
string | null |


getLink() : string | null
Get a link to the HTML source
Inherited from: \Zend_Feed_Writer_Feed_FeedAbstract::getLink()Type | Description |
---|---|
string | null |


getType() : string
Retrieve the current or last feed type exported.
Inherited from: \Zend_Feed_Writer_Feed_FeedAbstract::getType()Type | Description |
---|---|
string | Value will be "rss" or "atom" |


orderByDate() : void
Orders all indexed entries by date, thus offering date ordered readable content where a parser (or Homo Sapien) ignores the generic rule that XML element order is irrelevant and has no intrinsic meaning.
Using this method will alter the original indexation.


removeEntry(int $index) : void
Removes a specific indexed entry from the internal queue.
Entries must be added to a feed container in order to be indexed.
Name | Type | Description |
---|---|---|
$index | int |


reset() : void
Resets the instance and deletes all data
Inherited from: \Zend_Feed_Writer_Feed_FeedAbstract::reset()

setCopyright( $copyright) : string | null
Set the copyright entry
Inherited from: \Zend_Feed_Writer_Feed_FeedAbstract::setCopyright()Name | Type | Description |
---|---|---|
$copyright |
Type | Description |
---|---|
string | null |


setDateCreated( $date = null) : void
Set the feed creation date
Inherited from: \Zend_Feed_Writer_Feed_FeedAbstract::setDateCreated()Name | Type | Description |
---|---|---|
$date | null|integer|Zend_Date |


setDateModified( $date = null) : void
Set the feed modification date
Inherited from: \Zend_Feed_Writer_Feed_FeedAbstract::setDateModified()Name | Type | Description |
---|---|---|
$date | null|integer|Zend_Date |


setDescription( $description) : string | null
Set the feed description
Inherited from: \Zend_Feed_Writer_Feed_FeedAbstract::setDescription()Name | Type | Description |
---|---|---|
$description |
Type | Description |
---|---|
string | null |


setEncoding(string $encoding) : void
Set the feed character encoding
Inherited from: \Zend_Feed_Writer_Feed_FeedAbstract::setEncoding()Name | Type | Description |
---|---|---|
$encoding | string |


setFeedLink( $link, $type) : string | null
Set a link to an XML feed for any feed type/version
Inherited from: \Zend_Feed_Writer_Feed_FeedAbstract::setFeedLink()Name | Type | Description |
---|---|---|
$link | ||
$type |
Type | Description |
---|---|
string | null |


setGenerator( $name, $version = null, $uri = null) : string | null
Set the feed generator entry
Inherited from: \Zend_Feed_Writer_Feed_FeedAbstract::setGenerator()Name | Type | Description |
---|---|---|
$name | ||
$version | ||
$uri |
Type | Description |
---|---|
string | null |


setIcon(array $data) : void
Set a feed icon (URI at minimum).
Inherited from: \Zend_Feed_Writer_Feed_FeedAbstract::setIcon()Parameter is a single array with the required key 'uri'. Only 'uri' is required and used for Atom rendering. RSS does not support an Icon tag except via Atom 1.0 as an extension.
Name | Type | Description |
---|---|---|
$data | array |


setId(string $id) : void
Set the feed ID - URI or URN (via PCRE pattern) supported
Inherited from: \Zend_Feed_Writer_Feed_FeedAbstract::setId()Name | Type | Description |
---|---|---|
$id | string |


setImage(array $data) : void
Set a feed image (URI at minimum).
Inherited from: \Zend_Feed_Writer_Feed_FeedAbstract::setImage()Parameter is a single array with the required key 'uri'. When rendering as RSS, the required keys are 'uri', 'title' and 'link'. RSS also specifies three optional parameters 'width', 'height' and 'description'. Only 'uri' is required and used for Atom rendering.
Name | Type | Description |
---|---|---|
$data | array |


setLanguage( $language) : string | null
Name | Type | Description |
---|---|---|
$language |
Type | Description |
---|---|
string | null |


setLastBuildDate( $date = null) : void
Set the feed last-build date.
Inherited from: \Zend_Feed_Writer_Feed_FeedAbstract::setLastBuildDate()Ignored for Atom 1.0.
Name | Type | Description |
---|---|---|
$date | null|integer|Zend_Date |


setLink(string $link) : void
Set a link to the HTML source
Inherited from: \Zend_Feed_Writer_Feed_FeedAbstract::setLink()Name | Type | Description |
---|---|---|
$link | string |


setTitle( $title) : string | null
Name | Type | Description |
---|---|---|
$title |
Type | Description |
---|---|
string | null |


setType(string $type) : void
Set the current feed type being exported to "rss" or "atom".
Inherited from: \Zend_Feed_Writer_Feed_FeedAbstract::setType()This allows other objects to gracefully choose whether to execute or not, depending on their appropriateness for the current type, e.g. renderers.
Name | Type | Description |
---|---|---|
$type | string |