Public Member Functions | Static Public Member Functions

Comments Class Reference

List of all members.

Public Member Functions

 only ($field, $index)
 filter ($filter)
 __get ($name)

Static Public Member Functions

static get ($paramarray=array())
static by_email ($email= '')
static by_name ($name= '')
static by_ip ($ip= '')
static by_url ($url= '')
static by_post_id ($post_id)
static by_slug ($slug= '')
static by_status ($status=0)
static count_total ($status= 'approved', $type= 'comment')
static count_by_name ($name= '', $status= 'approved')
static count_by_email ($email= '', $status= 'approved')
static count_by_url ($url= '', $status= 'approved')
static count_by_ip ($ip= '', $status= 'approved')
static count_by_slug ($slug= '', $status= 'approved')
static count_by_id ($id=0, $status= 'approved')
static count_by_author ($id=0, $status= 'approved')
static delete_by_status ($status)
static search_to_get ($search_string)

Detailed Description

Definition at line 23 of file comments.php.


Member Function Documentation

Comments::__get ( name  ) 

Implements custom object properties

Parameters:
string $name Name of property to return
Returns:
mixed The requested field value

Definition at line 627 of file comments.php.

static Comments::by_email ( email = ''  )  [static]

selects all comments from a given email address

Parameters:
string $email an email address
Returns:
array an array of Comment objects written by that email address

Definition at line 488 of file comments.php.

static Comments::by_ip ( ip = ''  )  [static]

selects all comments from a given IP address

Parameters:
string $ip an IP address
Returns:
array an array of Comment objects written from the given IP

Definition at line 514 of file comments.php.

static Comments::by_name ( name = ''  )  [static]

selects all comments from a given name

Parameters:
string $name a name
Returns:
array an array of Comment objects written by the given name

Definition at line 501 of file comments.php.

static Comments::by_post_id ( post_id  )  [static]

Returns all comments for a supplied post ID

Parameters:
integer $post_id The id of a post
Returns:
array an array of Comment objects for the given post

Definition at line 540 of file comments.php.

static Comments::by_slug ( slug = ''  )  [static]

select all comments for a given post slug

Parameters:
string $slug a post slug
Returns:
array array an array of Comment objects for the given post

Definition at line 550 of file comments.php.

static Comments::by_status ( status = 0  )  [static]

select all comments of a given status

Parameters:
int $status a status value
Returns:
array an array of Comment objects with the same status

Definition at line 563 of file comments.php.

static Comments::by_url ( url = ''  )  [static]

select all comments from an author's URL

Parameters:
string $url a URL
Returns:
array array an array of Comment objects with the same URL

Definition at line 527 of file comments.php.

static Comments::count_by_author ( id = 0,
status = 'approved' 
) [static]

returns the number of comments attached to posts by the specified author

Parameters:
int $id a user ID
integer|string $status A comment status value, or false to not filter on status(default: 'approved')
Returns:
int a count of the comments attached to the specified post

Definition at line 805 of file comments.php.

Referenced by AdminDashboardHandler::get_dashboard().

static Comments::count_by_email ( email = '',
status = 'approved' 
) [static]

returns the number of comments attributed ot the specified email

Parameters:
string $email an email address
integer|string $status A comment status value, or false to not filter on status (default: 'approved')
Returns:
int a count of the comments from the specified email

Definition at line 730 of file comments.php.

static Comments::count_by_id ( id = 0,
status = 'approved' 
) [static]

returns the number of comments attached to the specified post

Parameters:
int $id a post ID
integer|string $status A comment status value, or false to not filter on status(default: 'approved')
Returns:
int a count of the comments attached to the specified post

Definition at line 790 of file comments.php.

Referenced by Post::__get().

static Comments::count_by_ip ( ip = '',
status = 'approved' 
) [static]

returns the number of comments from the specified IP address

Parameters:
string $ip an IP address
integer|string $status A comment status value, or false to not filter on status (default: 'approved')
Returns:
int a count of the comments from the specified IP address

Definition at line 760 of file comments.php.

static Comments::count_by_name ( name = '',
status = 'approved' 
) [static]

returns the number of comments attributed to the specified name

Parameters:
string $name a commenter's name
integer|string $status A comment status value, or false to not filter on status (default: 'approved')
Returns:
int a count of the comments from the specified name

Definition at line 715 of file comments.php.

static Comments::count_by_slug ( slug = '',
status = 'approved' 
) [static]

returns the number of comments attached to the specified post

Parameters:
string $slug a post slug
integer|string $status A comment status value, or false to not filter on status (default: 'approved')
Returns:
int a count of the comments attached to the specified post

Definition at line 775 of file comments.php.

static Comments::count_by_url ( url = '',
status = 'approved' 
) [static]

returns the number of comments attributed to the specified URL

Parameters:
string $url a URL
integer|string $status a comment status value, or false to not filter on status (default: 'approved')
Returns:
int a count of the comments from the specified URL

Definition at line 745 of file comments.php.

static Comments::count_total ( status = 'approved',
type = 'comment' 
) [static]

returns the number of comments based on the specified status and type

Parameters:
integer|string $status A comment status value, or false to not filter on status (default: 'approved')
integer|string $type A comment type value, or false to not filter on type (default: 'comment')
Returns:
int a count of the comments based on the specified status and type

Definition at line 703 of file comments.php.

Referenced by AtomHandler::get_comments(), and AdminDashboardHandler::get_dashboard().

static Comments::delete_by_status ( status  )  [static]

delete all the comments and commentinfo for comments with this status

Parameters:
integer|string $status a comment status ID or name

Definition at line 818 of file comments.php.

Referenced by AdminCommentsHandler::ajax_update_comment().

Comments::filter ( filter  ) 

Filter Comments using a callback function

Parameters:
Callable|array $filter A callback function that returns true if the item passed in should be kept
Returns:
Comments The filtered comments

Definition at line 595 of file comments.php.

Referenced by __get(), and get().

static Comments::get ( paramarray = array()  )  [static]

function get Returns requested comments

Parameters:
array $paramarray An associated array of parameters, or a querystring
Returns:
array An array of Comment objects, one for each query result

$comments = comments::get( array ( "author" => "skippy" ) ); $comments = comments::get( array ( "slug" => "first-post", "status" => "1", "orderby" => "date ASC" ) );

Definition at line 36 of file comments.php.

Referenced by CoreBlocks::action_block_content_recent_comments(), AdminCommentsHandler::ajax_update_comment(), by_email(), by_ip(), by_name(), by_post_id(), by_slug(), by_status(), by_url(), count_by_author(), count_by_email(), count_by_id(), count_by_ip(), count_by_name(), count_by_slug(), count_by_url(), count_total(), AtomHandler::get_comments(), and Pingback::xmlrpc_pingback__ping().

Comments::only ( field,
index 
)

Returns all of the comments from the current Comments object having the specified index for the specified field $tb = $comments->only( 'trackbacks' )

Parameters:
string $field The field on the comment that is being filtered
mixed $index The value of the field that qualifies a comment
Returns:
array an array of Comment objects of the specified type

Definition at line 575 of file comments.php.

Referenced by __get().

static Comments::search_to_get ( search_string  )  [static]

Parses a search string for status, type, author, and tag keywords. Returns an associative array which can be passed to Comments::get(). If multiple authors, statuses, or types are specified, we assume an implicit OR such that (e.g.) any author that matches would be returned.

Parameters:
string $search_string The search string
Returns:
array An associative array which can be passed to Comments::get()

Definition at line 836 of file comments.php.


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