Class Feed

Description

Implementation of a feed

A Feed instance contains a type, a version, a hash (etag), a last modified date, a syndication URL and a channel (FeedChannel).

When parsing external feeds using FeedReader, an instance of feed is used to collect the parsed information. When creating feeds through the FeedCreator class, this class contains utility methods to render the feed XML according with the feed type and version.

Located in /core/xml/feed/Feed.class.php (line 60)

PHP2Go
   |
   --FeedNode
      |
      --Feed
Variable Summary
Method Summary
Feed Feed (string $type, [string $version = NULL])
string getEtag ()
array getItems ()
string getLastModified ([string $fmt = 'r'])
unknown getSyndicationURL ()
bool isATOM ()
bool isRSS ()
array renderItems ()
void setChannel (FeedChannel $Channel)
void setETag (string $hash)
void setLastModified (int|string $lastModified)
void setSyndicationURL (string $url)
mixed _formatElementValue (mixed $value)
Variables
FeedChannel $Channel = NULL (line 111)

Feed's channel

string $contentType (line 83)

Content type

string $etag (line 90)

Etag (hash)

int $lastModified (line 97)

Last modified time

string $syndicationURL (line 104)

Syndication URL

string $type (line 69)

Feed type

It can be FEED_RSS or FEED_ATOM.

string $version (line 76)

Format version (specially for FEED_RSS)

Inherited Variables

Inherited from FeedNode

FeedNode::$children
Methods
Constructor Feed (line 120)

Class constructor

Feed Feed (string $type, [string $version = NULL])
  • string $type: Feed type
  • string $version: Format version
createDataSet (line 256)

Creates a data set and fills it with the feed items

DataSet &createDataSet ()
getChannel (line 228)

Get this feed's channel

FeedChannel &getChannel ()
getChannelElementNames (line 268)

Get a list of valid channel properties, according with feed type and version

array getChannelElementNames ()
getEtag (line 170)

Get feed's etag

string getEtag ()
getItemElementNames (line 316)

Get a list of valid item attributes, according with feed type and version

array getItemElementNames ()
getItems (line 247)

Get feed items

array getItems ()
getLastModified (line 189)

Get the last modified time of this feed

string getLastModified ([string $fmt = 'r'])
  • string $fmt: Date format
getSyndicationURL (line 210)

Get feed's syndication URL

unknown getSyndicationURL ()
isATOM (line 152)

Checks if this feed is an ATOM feed

bool isATOM ()
isRSS (line 161)

Checks if this feed is an RSS feed

bool isRSS ()
renderChannelElements (line 391)

Collects rendering data of the feed's channel

array renderChannelElements ()
renderItems (line 437)

Collects rendering data of the channel's items

array renderItems ()
renderRootProperties (line 361)

Collects attributes of the root node, when rendering feeds

array renderRootProperties ()
setChannel (line 237)

Set this feed's channel

void setChannel (FeedChannel $Channel)
setETag (line 179)

Set feed's etag

void setETag (string $hash)
  • string $hash: Etag
setLastModified (line 201)

Set feed's last modified time

The $lastModified argument can be provided as a timestamp value (integer), or a date written in RFC822 or ISO8601 formats.

void setLastModified (int|string $lastModified)
  • int|string $lastModified: Last modified time
setSyndicationURL (line 219)

Set the syndication URL of this feed

void setSyndicationURL (string $url)
  • string $url: Syndication URL
_formatElementValue (line 516)

Escapes HTML special chars on an element's value

This method is able to process scalar values, single and 2-dimension numeric or hash arrays.

  • access: private
mixed _formatElementValue (mixed $value)
  • mixed $value: Element's value

Inherited Methods

Inherited From FeedNode

FeedNode::FeedNode()
FeedNode::addChild()
FeedNode::addElement()
FeedNode::buildDate()
FeedNode::getChildren()
FeedNode::getElement()
FeedNode::parseDate()
FeedNode::setElement()

Inherited From PHP2Go

PHP2Go::PHP2Go()
PHP2Go::equals()
PHP2Go::generateUniqueId()
PHP2Go::getClassName()
PHP2Go::getConfigVal()
PHP2Go::getLangVal()
PHP2Go::getObjectName()
PHP2Go::getParentName()
PHP2Go::hasDestructor()
PHP2Go::hashCode()
PHP2Go::isA()
PHP2Go::isSubclassOf()
PHP2Go::logError()
PHP2Go::raiseError()
PHP2Go::registerDestructor()
PHP2Go::registerShutdownFunc()
PHP2Go::retrieve()
PHP2Go::store()
PHP2Go::__toString()

Documentation generated on Sun, 07 Oct 2007 19:23:58 -0300 by phpDocumentor 1.3.2