Stud.IP  2.4 Revision 48548
 All Data Structures Namespaces Files Functions Variables Groups Pages
RSSFeed Class Reference
Collaboration diagram for RSSFeed:
Collaboration graph

Public Member Functions

 __construct ($id=null)
 store ()
 delete ()
 moveUp ()
 moveDown ()
 render ($limit=-1)
 setLimit ($limit)

Static Public Member Functions

static checkAccess ($feed_id, $user_id=false)
static load ($id, $return_class=false)
static loadByUserId ($user_id)
static increasePriorities ()
static fetch ($url, $refresh=false)
static getLimit ()

Data Fields

const CONFIG_KEY = 'RSS_FEED_DISPLAY_LIMIT'
const DEFAULT_LIMIT = 10
 $id
 $url
 $name
 $fetch_title = 1
 $hidden = 1
 $priority = 0

Constructor & Destructor Documentation

__construct (   $id = null)

Constructs an rss feed object. Omit the id to create an empty feed.

Parameters
mixed$idId of the requested rss feed

Here is the call graph for this function:

Member Function Documentation

static checkAccess (   $feed_id,
  $user_id = false 
)
static

Checks whether the specified feed belongs to the specified user

Parameters
string$feed_idId of the feed in question
string$user_idId of the user in question, false for current user
Returns
boolean Indicates whether the feed belongs to the user

Here is the call graph for this function:

delete ( )

Deletes the feed from the database.

Returns
boolean Indicates whether the feed was actually deleted

Here is the call graph for this function:

static fetch (   $url,
  $refresh = false 
)
static

Fetches a feed from the given url using Magpie.

Parameters
string$urlURL of the feed to fetch
boolean$refreshIndicates whether the cache should be refreshed
Returns
mixed Magpie object representation of the feed or false on error

Here is the caller graph for this function:

static getLimit ( )
static

Returns the current user's limit of displayed feed items.

Returns
int The current user's limit of displayed feed items

Here is the call graph for this function:

Here is the caller graph for this function:

static increasePriorities ( )
static

Increases the priorities of all the current user's feeds by 1.

Here is the call graph for this function:

Here is the caller graph for this function:

static load (   $id,
  $return_class = false 
)
static

Loads a single feed with the specified id if the id is passed as a string or loads a bundle of feeds if the ids are passed as an array. Feeds can be returned as associative arrays containing the feeds' data or as complete RSSFeed objects. Results are always sorted by the feeds' priorities (not applicable if a single feed is requested).

Parameters
mixed$idId(s) of the feed(s) in question
boolean$return_classIndicates whether arrays or objects should be returned
Returns
mixed Array of feeds or single feed resp. empty array or false if no feeds match the id(s)

Here is the call graph for this function:

Here is the caller graph for this function:

static loadByUserId (   $user_id)
static

Loads all feeds of the requested user (sorted by priority).

Parameters
string$user_idId of the user in question.
Returns
array List of the user's feeds as RSSFeed objects

Here is the call graph for this function:

Here is the caller graph for this function:

moveDown ( )

Moves the feed downwards in the list of the user's feeds

Returns
booleean Indicates whether the feed was actually moved

Here is the call graph for this function:

moveUp ( )

Moves the feed upwards in the list of the user's feeds

Returns
booleean Indicates whether the feed was actually moved

Here is the call graph for this function:

render (   $limit = -1)

Renders the contents of the feed

Parameters
int$limitMaximum number of displayed item, -1 to display all
Returns
string Rendered html output

Here is the call graph for this function:

setLimit (   $limit)

Sets the current user's limit of displayed feed items.

Parameters
int$limitThe current user's limit of displayed feed items (pass -1 for no limit)

Here is the call graph for this function:

Here is the caller graph for this function:

store ( )

Stores feed in database.

Returns
boolean Indicates whether feed was actually stored

Here is the call graph for this function:

Field Documentation

$fetch_title = 1
$hidden = 1
$id
$name
$priority = 0
$url
const CONFIG_KEY = 'RSS_FEED_DISPLAY_LIMIT'
const DEFAULT_LIMIT = 10

The documentation for this class was generated from the following file: