Axiom (v1.2.0)

A lightweight PHP framework
axFeed Class Reference

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.

Detailed Description

Generic Feed Class.

Todo:

axFeed long description

This class needs to be tested

Author:
Delespierre
License:
http://www.gnu.org/licenses/lgpl.html Lesser General Public Licence version 3

Definition at line 18 of file axFeed.class.php.


Constructor & Destructor Documentation

axFeed::__construct ( type,
array $  items = array(),
array $  meta_inf = array() 
)

Constructor.

Parameters:
string$typeThe 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.


Member Function Documentation

axFeed::__get ( key)

Getter.

Allow the use of every $feed->getXXX() as $feed->XXX

Parameters:
string$key
Exceptions:
InvalidArgumentExceptionIf the $key doesn't exists
Returns:
mixed

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

Parameters:
string$key
mixed$value
Returns:
void

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.

Parameters:
axFeedEntry$entry[optional] [default null]
Returns:
axFeedEntry

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)

Parameters:
string$type[optional] [default null]
Exceptions:
RuntimeExceptionIf the feed writer for this type was not found
Returns:
axFeedWriter

Definition at line 335 of file axFeed.class.php.

Get meta-inf author.

Returns:
array

Definition at line 210 of file axFeed.class.php.

Get meta-inf copyright.

Returns:
string

Definition at line 287 of file axFeed.class.php.

Get meta-inf date.

Returns:
string

Definition at line 182 of file axFeed.class.php.

Get meta-inf description.

Returns:
string

Definition at line 266 of file axFeed.class.php.

Get all feed entries attached to the feed.

Returns:
array

Definition at line 128 of file axFeed.class.php.

Get meta-inf id parameter.

Returns:
string

Definition at line 137 of file axFeed.class.php.

Get meta-inf lang.

Returns:
string

Definition at line 246 of file axFeed.class.php.

Get meta-inf link.

Returns:
string

Definition at line 307 of file axFeed.class.php.

Get meta-inf title.

Returns:
string

Definition at line 161 of file axFeed.class.php.

axFeed::setAuthor ( array $  author)

Set meta-inf author.

Todo:
Refactor this method to use the filter_var_array function
Exceptions:
InvalidArgumentExceptionIf $author mail, name or URI is invalid
Parameters:
array$author
Returns:
axFeed

Definition at line 222 of file axFeed.class.php.

axFeed::setCopyright ( copyright)

Set meta-inf copyright.

Parameters:
string$copyright
Returns:
axFeed

Definition at line 297 of file axFeed.class.php.

axFeed::setDate ( date)

Set meta-inf date.

This method accepts both strings and integers (timestamp).

Exceptions:
InvalidArgumentExceptionIf $date parameter is invalid
Parameters:
mixed$date
Returns:
axFeed

Definition at line 195 of file axFeed.class.php.

axFeed::setDescription ( description)

Set meta-inf description.

Parameters:
string$description
Returns:
axFeed

Definition at line 276 of file axFeed.class.php.

axFeed::setId ( id)

Set meta-inf id parameter.

Exceptions:
InvalidArgumentExceptionIf $id is invalid
Parameters:
string$id
Returns:
axFeed

Definition at line 148 of file axFeed.class.php.

axFeed::setLang ( lang)

Set meta-inf lang.

Parameters:
string$lang
Returns:
axFeed

Definition at line 256 of file axFeed.class.php.

axFeed::setLink ( url)

Set meta-inf link.

Exceptions:
InvalidArgumentExceptionIf $url is not a valid URL
Parameters:
string$url
Returns:
axFeed

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'),
 );
Parameters:
array$meta_inf[optional] [default array()]
Returns:
axFeed

Definition at line 54 of file axFeed.class.php.

axFeed::setTitle ( title)

Set meta-inf title.

Parameters:
string$title
Returns:
axFeed

Definition at line 171 of file axFeed.class.php.


Field Documentation

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.


The documentation for this class was generated from the following file:
 All Data Structures Files Functions Variables