PHP Class Comments_model, 68kb

Inheritance: extends CI_Model
Afficher le fichier Open project: 68kb/68kb Class Usage Examples

Méthodes publiques

Méthode 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 méthode

Constructor
public __construct ( ) : void
Résultat void

add_comment() public méthode

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

change_display() public méthode

Chagne Display
public change_display ( $status, $id )

delete_comment() public méthode

Delete Category
public delete_comment ( $id ) : true
Résultat true on success.

edit_comment() public méthode

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

email_admin() public méthode

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

get_article_comments() public méthode

Get approved comments based of article id
public get_article_comments ( $id ) : array
Résultat array

get_article_comments_count() public méthode

Get approved comments count based of article id
public get_article_comments_count ( $id ) : integer
Résultat integer

get_new_comments() public méthode

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

spam_check() public méthode

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
Résultat mixed