content
Packages
Interfaces
Classes
Files

Class: Feed

Source Location: /content/syndication/feed.class.php [line 42]

Class Overview


This class could be used to export feeds

Author(s):



Class Details

This class could be used to export feeds

Tags:

  • author: Loïc Rouchon <horn@phpboost.com>
  • abstract: Do not use this class, but one of its children like RSS or ATOM
[ Top ] - [ Class Details ] - [ Methods ] - [ Variables ]


Class Methods

constructor Feed [line 52]

Feed Feed( string $module_id, [string $name = DEFAULT_FEED_NAME], [int $id_cat = 0])
Builds a new feed object

Parameters:

string   $module_id   its module_id
string   $name   the feeds name / type. default is DEFAULT_FEED_NAME
int   $id_cat   the feed category id
[ Top ] - [ Class Details ] - [ Methods ] - [ Variables ]

method cache [line 150]

void cache( )
Send the feed data in the cache
[ Top ] - [ Class Details ] - [ Methods ] - [ Variables ]

method export [line 79]

string export( [mixed $template = false], [int $number = 10], [int $begin_at = 0])
Exports the feed as a string parsed by the <$tpl> template

Tags:

  • return: The exported feed

Parameters:

mixed   $template   If false, uses de default tpl. If an associative array, uses the default tpl but assigns it the array vars first. It could also be a Template object
int   $number   the number of item to display
int   $begin_at   the first item to display
[ Top ] - [ Class Details ] - [ Methods ] - [ Variables ]

method get_cache_file_name [line 165]

string get_cache_file_name( )
Returns the feed data cache filename

Tags:

  • return: the feed data cache filename
[ Top ] - [ Class Details ] - [ Methods ] - [ Variables ]

method is_in_cache [line 159]

bool is_in_cache( )
Returns true if the feed data are in the cache

Tags:

  • return: true if the feed data are in the cache
[ Top ] - [ Class Details ] - [ Methods ] - [ Variables ]

method load_data [line 63]

void load_data( FeedData $data)
Loads a FeedData element

Parameters:

FeedData   $data   the element to load
[ Top ] - [ Class Details ] - [ Methods ] - [ Variables ]

method load_file [line 68]

void load_file( string $url)
Loads a feed by its url

Overridden in child classes as:

ATOM::load_file()
Loads a feed by its url
RSS::load_file()
Loads a feed by its url

Parameters:

string   $url   the feed url
[ Top ] - [ Class Details ] - [ Methods ] - [ Variables ]

method read [line 133]

string read( )
Loads the feed data in cache and export it

Tags:

  • return: the exported feed
[ Top ] - [ Class Details ] - [ Methods ] - [ Variables ]

static method clear_cache [line 186]

static void clear_cache( [mixed $module_id = false])
Clear the cache of the specified module_id.

Parameters:

mixed   $module_id   the module module_id or false. If false, Clear all feeds data from the cache
[ Top ] - [ Class Details ] - [ Methods ] - [ Variables ]

static method get_feed_menu [line 302]

static string get_feed_menu( string $feed_url)
Generates the code which shows all the feeds formats.

Tags:

  • return: The HTML code to display.

Parameters:

string   $feed_url   Feed URL
[ Top ] - [ Class Details ] - [ Methods ] - [ Variables ]

static method get_parsed [line 234]

static string get_parsed( string $module_id, [string $name = DEFAULT_FEED_NAME], [int $idcat = 0], [mixed $tpl = false], [int $number = 10], [int $begin_at = 0])
Export a feed

Tags:

  • return: The exported feed

Parameters:

string   $module_id   the module id
string   $name   the feed name / type
int   $idcat   the feed data category
mixed   $tpl   If false, uses de default tpl. If an associative array, uses the default tpl but assigns it the array vars first. It could also be a Template object
int   $number   the number of item to display
int   $begin_at   the first item to display
[ Top ] - [ Class Details ] - [ Methods ] - [ Variables ]

static method update_cache [line 213]

static void update_cache( string $module_id, string $name, &$data, [int $idcat = 0], &FeedData $data)
Update the cache of the $module_id, $name, $idcat feed with $data

Parameters:

string   $module_id   the module id
string   $name   the feed name / type
&FeedData   $data   the data to put in the cache
int   $idcat   the feed data category
   &$data  
[ Top ] - [ Class Details ] - [ Methods ] - [ Variables ]


Class Variables

[line 174]   mixed  $data  =  null
[ Top ] - [ Class Details ] - [ Methods ] - [ Variables ]
[line 170]   mixed  $id_cat  =  0
[ Top ] - [ Class Details ] - [ Methods ] - [ Variables ]
[line 169]   mixed  $module_id  =  ''
[ Top ] - [ Class Details ] - [ Methods ] - [ Variables ]
[line 171]   mixed  $name  =  ''
[ Top ] - [ Class Details ] - [ Methods ] - [ Variables ]
[line 172]   mixed  $str  =  ''
[ Top ] - [ Class Details ] - [ Methods ] - [ Variables ]
[line 173]   mixed  $tpl  =  null
[ Top ] - [ Class Details ] - [ Methods ] - [ Variables ]
Documentation generated on Tue, 28 Jul 2009 22:43:36 +0200 by phpDocumentor 1.4.1