class Feed implements ArrayAccess, Countable

Class to encapsulate a feed for the Joomla Platform.

Properties

FeedPerson $author FeedPerson$authorPerson responsible for feed content.
array $categories array$categoriesCategories to which the feed belongs.
array $contributors array$contributorsPeople who contributed to the feed content.
$copyright string$copyrightInformation about rights, e.g. copyrights, held in and over the feed.
string $description string$descriptionA phrase or sentence describing the feed.
string $generator string$generatorA string indicating the program used to generate the feed.
string $image string$imageSpecifies a GIF, JPEG or PNG image that should be displayed with the feed.
Date $publishedDate Date$publishedDateThe publication date for the feed content.
string $title string$titleA human readable title for the feed.
Date $updatedDate Date$updatedDateThe last time the content of the feed changed.
string $uri string$uriUniversal, permanent identifier for the feed.

Methods

mixed
__get( string $name)

Magic method to return values for feed properties.

void
__set( string $name, mixed $value)

Magic method to set values for feed properties.

addCategory( string $name, string $uri = '')

Method to add a category to the feed object.

addContributor( string $name, string $email, string $uri = null, string $type = null)

Method to add a contributor to the feed object.

addEntry( FeedEntry $entry)

Method to add an entry to the feed object.

integer
count()

Returns a count of the number of entries in the feed.

boolean
offsetExists( mixed $offset)

Whether or not an offset exists. This method is executed when using isset() or empty() on objects implementing ArrayAccess.

mixed
offsetGet( mixed $offset)

Returns the value at specified offset.

boolean
offsetSet( mixed $offset, FeedEntry $value)

Assigns a value to the specified offset.

void
offsetUnset( mixed $offset)

Unsets an offset.

removeCategory( string $name)

Method to remove a category from the feed object.

removeContributor( FeedPerson $contributor)

Method to remove a contributor from the feed object.

removeEntry( FeedEntry $entry)

Method to remove an entry from the feed object.

setAuthor( string $name, string $email, string $uri = null, string $type = null)

Shortcut method to set the author for the feed object.

reverseItems()

Method to reverse the items if display is set to 'oldest first'

Details

mixed __get( string $name)

Magic method to return values for feed properties.

Parameters

string $name The name of the property.

Return Value

mixed

void __set( string $name, mixed $value)

Magic method to set values for feed properties.

Parameters

string $name The name of the property.
mixed $value The value to set for the property.

Return Value

void

Feed addCategory( string $name, string $uri = '')

Method to add a category to the feed object.

Parameters

string $name The name of the category to add.
string $uri The optional URI for the category to add.

Return Value

Feed

Feed addContributor( string $name, string $email, string $uri = null, string $type = null)

Method to add a contributor to the feed object.

Parameters

string $name The full name of the person to add.
string $email The email address of the person to add.
string $uri The optional URI for the person to add.
string $type The optional type of person to add.

Return Value

Feed

Feed addEntry( FeedEntry $entry)

Method to add an entry to the feed object.

Parameters

FeedEntry $entry The entry object to add.

Return Value

Feed

integer count()

Returns a count of the number of entries in the feed.

This method is here to implement the Countable interface. You can call it by doing count($feed) rather than $feed->count();

Return Value

integer number of entries in the feed.

boolean offsetExists( mixed $offset)

Whether or not an offset exists. This method is executed when using isset() or empty() on objects implementing ArrayAccess.

Parameters

mixed $offset An offset to check for.

Return Value

boolean

See also

ArrayAccess::offsetExists()

mixed offsetGet( mixed $offset)

Returns the value at specified offset.

Parameters

mixed $offset The offset to retrieve.

Return Value

mixed The value at the offset.

See also

ArrayAccess::offsetGet()

boolean offsetSet( mixed $offset, FeedEntry $value)

Assigns a value to the specified offset.

Parameters

mixed $offset The offset to assign the value to.
FeedEntry $value The JFeedEntry to set.

Return Value

boolean

Exceptions

InvalidArgumentException

See also

ArrayAccess::offsetSet()

void offsetUnset( mixed $offset)

Unsets an offset.

Parameters

mixed $offset The offset to unset.

Return Value

void

See also

ArrayAccess::offsetUnset()

Feed removeCategory( string $name)

Method to remove a category from the feed object.

Parameters

string $name The name of the category to remove.

Return Value

Feed

Feed removeContributor( FeedPerson $contributor)

Method to remove a contributor from the feed object.

Parameters

FeedPerson $contributor The person object to remove.

Return Value

Feed

Feed removeEntry( FeedEntry $entry)

Method to remove an entry from the feed object.

Parameters

FeedEntry $entry The entry object to remove.

Return Value

Feed

Feed setAuthor( string $name, string $email, string $uri = null, string $type = null)

Shortcut method to set the author for the feed object.

Parameters

string $name The full name of the person to set.
string $email The email address of the person to set.
string $uri The optional URI for the person to set.
string $type The optional type of person to set.

Return Value

Feed

Feed reverseItems()

Method to reverse the items if display is set to 'oldest first'

Return Value

Feed