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:
- int id
- int type
- string title
Each feed will be returned as an array with the following data:
- id
- link_id - Corresponds to the link model
- title
- description
- filter_authors - An array of authors to include in the feed.
- filter_topics - An array of included topics.
- type - The content_type_id for the content shown in this feed.
- type_name - The name of that content type.
- summary_field - The field name of the summary field for content retrieved.
- url - Full URL to feed
- url_path - URL path to feed
- template - The template used to display this feed.
- sort_field
- sort_dir
// get all feeds that show content_type_id #4 (e.g., Articles)
$feeds = $this->feed_model->get_feeds(array('type' => 4));