Generic Feed Class. More...
Public Member Functions | |
setMetaInf (array $meta_inf=array()) | |
Set all feeds meta informations. | |
__construct ($type, array $items=array(), array $meta_inf=array()) | |
Constructor. | |
__get ($key) | |
Getter. | |
__set ($key, $value) | |
Setter helper. | |
add (axFeedEntry $entry=null) | |
Add a feed entry and return it to allow chaining calls. | |
getEntries () | |
Get all feed entries attached to the feed. | |
getId () | |
Get meta-inf id parameter. | |
setId ($id) | |
Set meta-inf id parameter. | |
getTitle () | |
Get meta-inf title. | |
setTitle ($title) | |
Set meta-inf title. | |
getDate () | |
Get meta-inf date. | |
setDate ($date) | |
Set meta-inf date. | |
getAuthor () | |
Get meta-inf author. | |
setAuthor (array $author) | |
Set meta-inf author. | |
getLang () | |
Get meta-inf lang. | |
setLang ($lang) | |
Set meta-inf lang. | |
getDescription () | |
Get meta-inf description. | |
setDescription ($description) | |
Set meta-inf description. | |
getCopyright () | |
Get meta-inf copyright. | |
setCopyright ($copyright) | |
Set meta-inf copyright. | |
getLink () | |
Get meta-inf link. | |
setLink ($url) | |
Set meta-inf link. | |
build ($type=null) | |
Build the feed using a feed writer conector. | |
Protected Attributes | |
$_meta_inf = array() | |
Feed meta informations. | |
$_type | |
Feed configuration. |
Generic Feed Class.
Definition at line 18 of file axFeed.class.php.
axFeed::__construct | ( | $ | type, |
array $ | items = array() , |
||
array $ | meta_inf = array() |
||
) |
Constructor.
string | $type | The feed type, possible values are 'Atom' or 'Rss' |
array | $items | [optional] [default array() ] An array of axFeedItem |
array | $meta_infs | [optional] [default array() ] See axFeed::setMetaInf |
Definition at line 66 of file axFeed.class.php.
axFeed::__get | ( | $ | key | ) |
Getter.
Allow the use of every $feed->getXXX() as $feed->XXX
string | $key |
InvalidArgumentException | If the $key doesn't exists |
Definition at line 84 of file axFeed.class.php.
axFeed::__set | ( | $ | key, |
$ | value | ||
) |
Setter helper.
Allow the use of $feed->setXXX(YYY)
as $feed->XXX
= YYY
string | $key | |
mixed | $value |
Definition at line 100 of file axFeed.class.php.
axFeed::add | ( | axFeedEntry $ | entry = null | ) |
Add a feed entry and return it to allow chaining calls.
The first parameter is optionnal, if you don't set it manually, an empty axFeedEntry will be created and returned so you can manipulate it.
axFeedEntry | $entry | [optional] [default null ] |
Definition at line 116 of file axFeed.class.php.
axFeed::build | ( | $ | type = null | ) |
Build the feed using a feed writer conector.
If the $type
parameter is not present, will use the default type (passed to the constructor)
string | $type | [optional] [default null ] |
RuntimeException | If the feed writer for this type was not found |
Definition at line 335 of file axFeed.class.php.
axFeed::getDate | ( | ) |
Get all feed entries attached to the feed.
Definition at line 128 of file axFeed.class.php.
axFeed::getId | ( | ) |
axFeed::getLang | ( | ) |
axFeed::getLink | ( | ) |
axFeed::getTitle | ( | ) |
axFeed::setAuthor | ( | array $ | author | ) |
Set meta-inf author.
InvalidArgumentException | If $author mail, name or URI is invalid |
array | $author |
Definition at line 222 of file axFeed.class.php.
axFeed::setCopyright | ( | $ | copyright | ) |
Set meta-inf copyright.
string | $copyright |
Definition at line 297 of file axFeed.class.php.
axFeed::setDate | ( | $ | date | ) |
Set meta-inf date.
This method accepts both strings and integers (timestamp).
InvalidArgumentException | If $date parameter is invalid |
mixed | $date |
Definition at line 195 of file axFeed.class.php.
axFeed::setDescription | ( | $ | description | ) |
Set meta-inf description.
string | $description |
Definition at line 276 of file axFeed.class.php.
axFeed::setId | ( | $ | id | ) |
Set meta-inf id parameter.
InvalidArgumentException | If $id is invalid |
string | $id |
Definition at line 148 of file axFeed.class.php.
axFeed::setLang | ( | $ | lang | ) |
Set meta-inf lang.
string | $lang |
Definition at line 256 of file axFeed.class.php.
axFeed::setLink | ( | $ | url | ) |
Set meta-inf link.
InvalidArgumentException | If $url is not a valid URL |
string | $url |
Definition at line 318 of file axFeed.class.php.
axFeed::setMetaInf | ( | array $ | meta_inf = array() | ) |
Set all feeds meta informations.
$meta_inf
parmaeter is structured as follow
array( 'title' => 'Axiom Generic Feed', 'date' => date('r'), 'author' => array( 'name' => 'Benjamin DELESPIERRE', 'mail' => 'benjamin.delespierre@gmail.com'), 'lang' => axLang::getLocale(), 'description' => 'Axiom Generic Feed', 'copyright' => null, 'link' => url('feed'), 'id' => uniqid('ax'), );
array | $meta_inf | [optional] [default array() ] |
Definition at line 54 of file axFeed.class.php.
axFeed::setTitle | ( | $ | title | ) |
Set meta-inf title.
string | $title |
Definition at line 171 of file axFeed.class.php.
array axFeed::$_meta_inf = array() [protected] |
Feed meta informations.
Definition at line 24 of file axFeed.class.php.
array axFeed::$_type [protected] |
Feed configuration.
Definition at line 30 of file axFeed.class.php.