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

Public Member Functions

 load_user ()
 load_news ()
 load_parent ()
 load_children ($recursive=false)
 save ($new=true)
 delete ()
 __get ($key)

Static Public Member Functions

static load_comment_tree ($news_id)

Data Fields

 $table_name = 'newscomments'
 $columns = array('id', 'posted_by', 'news_id', 'parent_id', 'content', 'time_posted', 'deleted')
 $cache_keys = array( 'newscomment/#' => 'id', 'newscomment/user:#' => 'posted_by', 'newscomment/parent:#' => 'parent_id', 'newscomment/news:#' => 'news_id')
 $has_many = array('children')
 $has_one = array('parent_comment', 'user', 'news')
 $public_columns = array( 'id', 'posted_by', 'news_id', 'parent_id', 'content', 'time_posted', 'children' )

Detailed Description

Represents a single comment on a news/event item

Definition at line 6 of file newscomment.php.


Member Function Documentation

__get ( key)

Reimplemented from ActiveRecord.

Definition at line 161 of file newscomment.php.

delete ( )

Soft-delete this comment by flagging it as deleted

Definition at line 156 of file newscomment.php.

load_children ( recursive = false)

Load all children comments of this comment

Parameters:
$recursiveRecursively load all comments below this one

Definition at line 89 of file newscomment.php.

static load_comment_tree ( news_id) [static]

Recursively load the comment tree given a news/event ID

Definition at line 17 of file newscomment.php.

load_news ( )

Load the news item that this comment was posted under

Definition at line 59 of file newscomment.php.

load_parent ( )

Load the parent comment of this comment (if any)

Definition at line 72 of file newscomment.php.

load_user ( )

Load the user that posted this comment

Definition at line 44 of file newscomment.php.

save ( new = true)

Save this comment and insert it into Redis as well as MySQL

Definition at line 122 of file newscomment.php.


Field Documentation

$cache_keys = array( 'newscomment/#' => 'id', 'newscomment/user:#' => 'posted_by', 'newscomment/parent:#' => 'parent_id', 'newscomment/news:#' => 'news_id')

Definition at line 9 of file newscomment.php.

$columns = array('id', 'posted_by', 'news_id', 'parent_id', 'content', 'time_posted', 'deleted')

Reimplemented from ActiveRecord.

Definition at line 8 of file newscomment.php.

$has_many = array('children')

Reimplemented from ActiveRecord.

Definition at line 10 of file newscomment.php.

$has_one = array('parent_comment', 'user', 'news')

Reimplemented from ActiveRecord.

Definition at line 11 of file newscomment.php.

$public_columns = array( 'id', 'posted_by', 'news_id', 'parent_id', 'content', 'time_posted', 'children' )

Definition at line 12 of file newscomment.php.

$table_name = 'newscomments'

Reimplemented from ActiveRecord.

Definition at line 7 of file newscomment.php.


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