User Guide & Reference Manual

RSS Feed Model

RSS feeds can be automatically generated by Hero based on a set of author filters, topic filters, and a content type. This model allows you to create, update, delete, and retrieve RSS feeds being generated automatically by Hero. It also includes methods used by the RSS controller to display a feed.

Initialization


$this->load->model('rss/rss_model');
// methods available at $this->rss_model->x();

Method Reference

int new_feed (int $content_type_id , string $title , string $url_path , string $description [, array $filter_author = array() [, array $filter_topic = array() [, string $summary_field = FALSE [, string $sort_field = '' [, string $sort_dir = '' [, string $template = 'rss_feed.txml']]]]]])

Create a new feed/archive listing with these parameters.

void update_feed (int $feed_id , int $content_type_id , string $title , string $url_path , string $description [, array $filter_author = array() [, array $filter_topic = array() [, string $summary_field = FALSE [, string $sort_field = '' [, string $sort_dir = '' [, string $template = 'rss_feed.txml']]]]]])

Update an existing feed/archive with these parameters. Specify the feed with $feed_id.

boolean delete_feed (int $feed_id)

Delete an existing feed.

int get_feed_id (string $url_path)

Return the ID of a feed based on its URL path (used in the feeds controller).

array get_feed_content (int $feed_id [, int $page = 0])

Retrieve all content (via content_model->get_contents()) for a feed.

array get_feed (int $feed_id)

Retrieve details about a single feed by ID.

array get_feeds ( [array $filters = array()])

Retrieve details about a feed or feed based on optional filters.

Possible Filters:

Each feed will be returned as an array with the following data:


// get all feeds that show content_type_id #4 (e.g., Articles)
$feeds = $this->feed_model->get_feeds(array('type' => 4));