PHP Class Comments_model, 68kb

Inheritance: extends CI_Model
Show file Open project: 68kb/68kb Class Usage Examples

Public Methods

Method Description
__construct ( ) : void Constructor
add_comment ( array $data ) : mixed Add Comment
change_display ( $status, $id ) Chagne Display
delete_comment ( $id ) : true Delete Category
edit_comment ( $id, array $data ) : true Edit Category
email_admin ( $id, $data = '' ) : integer Email the admin about the comment
get_article_comments ( $id ) : array Get approved comments
get_article_comments_count ( $id ) : integer Get approved comments count
get_new_comments ( $date ) : array Get a list of all new orders since a certain timestamp
spam_check ( $email, $comment ) : mixed Spam Check

Method Details

__construct() public method

Constructor
public __construct ( ) : void
return void

add_comment() public method

Add Comment
public add_comment ( array $data ) : mixed
$data array An array of data.
return mixed Id on success.

change_display() public method

Chagne Display
public change_display ( $status, $id )

delete_comment() public method

Delete Category
public delete_comment ( $id ) : true
return true on success.

edit_comment() public method

Edit Category
public edit_comment ( $id, array $data ) : true
$data array An array of data.
return true on success.

email_admin() public method

Email the admin about the comment
public email_admin ( $id, $data = '' ) : integer
return integer

get_article_comments() public method

Get approved comments based of article id
public get_article_comments ( $id ) : array
return array

get_article_comments_count() public method

Get approved comments count based of article id
public get_article_comments_count ( $id ) : integer
return integer

get_new_comments() public method

Get a list of all new orders since a certain timestamp
public get_new_comments ( $date ) : array
return array

spam_check() public method

Very simple spam checker. Checks the comment for links and if they already have one approved comment. I didn't add any hooks here because I thought it would be better to check after it is submitted so you can do a query and get everything about the comment.
public spam_check ( $email, $comment ) : mixed
return mixed