Campustream 1.0
A social network MQP for WPI
Newsevent_Model Class Reference
Inheritance diagram for Newsevent_Model:
ActiveRecord

Public Member Functions

 load_category ()
 load_user ()
 load_comments ()
 load_eventmeta ()
 save ($voteup=false)
 vote ($dir)
 has_voted ($user_id=false)
 __get ($key)

Static Public Member Functions

static load_popular ($opts=false)

Data Fields

 $table_name = 'newsevents'
 $columns = array('id', 'type', 'category_id', 'newsevent', 'title', 'post', 'posted_by', 'time_posted', 'votes', 'num_comments')
 $cache_keys = array( 'newsevent/#' => 'id', 'newsevents/type:#' => 'type', 'newsevents/category:#' => 'category', 'newsevents/user:#' => 'posted_by' )
 $has_many = array('comments')
 $has_one = array('category', 'user', 'eventmeta')
 $public_columns = array( 'id', 'short_id', 'type', 'category_id', 'newsevent', 'title', 'post', 'posted_by', 'time_posted', 'votes', 'num_comments', 'comments', 'user', 'eventmeta' )

Detailed Description

Represents a news/event item

Definition at line 6 of file newsevent.php.


Member Function Documentation

__get ( key)

Reimplemented from ActiveRecord.

Definition at line 244 of file newsevent.php.

has_voted ( user_id = false)

Has the given user (or the currently active user) voted on this news/event story yet?

Definition at line 211 of file newsevent.php.

load_category ( )

Load the category that pertains to this news/event item

Definition at line 17 of file newsevent.php.

load_comments ( )

Load all comments posted under this news/event item

Definition at line 44 of file newsevent.php.

load_eventmeta ( )

Load metadata for this event

Definition at line 54 of file newsevent.php.

static load_popular ( opts = false) [static]

Load a list of popular news and/or events. Uses the Reddit algorithm for measuring popularity.

Definition at line 72 of file newsevent.php.

load_user ( )

Load the user that posted this news/event item

Definition at line 29 of file newsevent.php.

save ( voteup = false)

Save this news/event item and post a status message about it

Definition at line 137 of file newsevent.php.

vote ( dir)

Add or remove a vote for this news/event item

Definition at line 161 of file newsevent.php.


Field Documentation

$cache_keys = array( 'newsevent/#' => 'id', 'newsevents/type:#' => 'type', 'newsevents/category:#' => 'category', 'newsevents/user:#' => 'posted_by' )

Definition at line 9 of file newsevent.php.

$columns = array('id', 'type', 'category_id', 'newsevent', 'title', 'post', 'posted_by', 'time_posted', 'votes', 'num_comments')

Reimplemented from ActiveRecord.

Definition at line 8 of file newsevent.php.

$has_many = array('comments')

Reimplemented from ActiveRecord.

Definition at line 10 of file newsevent.php.

$has_one = array('category', 'user', 'eventmeta')

Reimplemented from ActiveRecord.

Definition at line 11 of file newsevent.php.

$public_columns = array( 'id', 'short_id', 'type', 'category_id', 'newsevent', 'title', 'post', 'posted_by', 'time_posted', 'votes', 'num_comments', 'comments', 'user', 'eventmeta' )

Definition at line 12 of file newsevent.php.

$table_name = 'newsevents'

Reimplemented from ActiveRecord.

Definition at line 7 of file newsevent.php.


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