Class Comments

Description

Habari Comments Class

Located in /system/classes/comments.php (line 8)

ArrayObject
   |
   --Comments
Method Summary
static array by_email ([string $email = ''])
static array by_ip ([string $ip = ''])
static array by_name ([string $name = ''])
static array by_post_id (post_id $post_id)
static array by_slug ([string $slug = ''])
static array by_status ([int $status = 0])
static array by_url ([string $url = ''])
static int count_by_email ([string $email = ''], [mixed $status = Comment::STATUS_APPROVED])
static int count_by_id ([int $id = 0], [mixed $status = Comment::STATUS_APPROVED])
static int count_by_ip ([string $ip = ''], [mixed $status = Comment::STATUS_APPROVED])
static int count_by_name ([string $name = ''], [mixed $status = Comment::STATUS_APPROVED])
static int count_by_slug ([string $slug = ''], [mixed $status = Comment::STATUS_APPROVED])
static int count_by_url ([string $url = ''], [mixed $status = Comment::STATUS_APPROVED])
static int count_total ([mixed $status = Comment::STATUS_APPROVED], [mixed $type = Comment::COMMENT])
static void delete_by_status (mixed $status)
static void delete_these (mixed $comments)
static array get ([array $paramarray = array()])
static void moderate_these (mixed $comments, [ $status = Comment::STATUS_UNAPPROVED])
static array search_to_get (string $search_string)
static int set (array $params)
void delete ()
array only ([ $what = 'approved'])
mixed __get (string $name)
Methods
static method by_email (line 346)

function by_email

selects all comments from a given email address

  • return: an array of Comment objects written by that email address
  • access: public
static array by_email ([string $email = ''])
  • string $email: an email address
static method by_ip (line 374)

function by_ip

selects all comments from a given IP address

  • return: an array of Comment objects written from the given IP
  • access: public
static array by_ip ([string $ip = ''])
  • string $ip: an IP address
static method by_name (line 360)

function by_name

selects all comments from a given name

  • return: an array of Comment objects written by the given name
  • access: public
static array by_name ([string $name = ''])
  • string $name: a name
static method by_post_id (line 401)

Returns all comments for a supplied post ID

  • return: an array of Comment objects for the given post
  • access: public
static array by_post_id (post_id $post_id)
  • post_id $post_id: ID of the post
static method by_slug (line 412)

function by_slug

select all comments for a given post slug

  • return: array an array of Comment objects for the given post
  • access: public
static array by_slug ([string $slug = ''])
  • string $slug: a post slug
static method by_status (line 426)

function by_status

select all comments of a given status

  • return: an array of Comment objects with the same status
  • access: public
static array by_status ([int $status = 0])
  • int $status: a status value
static method by_url (line 388)

function by_url

select all comments from an author's URL

  • return: array an array of Comment objects with the same URL
  • access: public
static array by_url ([string $url = ''])
  • string $url: a URL
static method count_by_email (line 569)

static count_by_email

returns the number of comments attributed ot the specified email

  • return: a count of the comments from the specified email
  • access: public
static int count_by_email ([string $email = ''], [mixed $status = Comment::STATUS_APPROVED])
  • string $email: an email address
  • mixed $status: A comment status value, or FALSE to not filter on status (default: Comment::STATUS_APPROVED)
static method count_by_id (line 632)

static count_by_id

returns the number of comments attached to the specified post

  • return: a count of the comments attached to the specified post
  • access: public
static int count_by_id ([int $id = 0], [mixed $status = Comment::STATUS_APPROVED])
  • int $id: a post ID
  • mixed $status: A comment status value, or FALSE to not filter on status(default: Comment::STATUS_APPROVED)
static method count_by_ip (line 600)

static count_by_ip

returns the number of comments from the specified IP address

  • return: a count of the comments from the specified IP address
  • access: public
static int count_by_ip ([string $ip = ''], [mixed $status = Comment::STATUS_APPROVED])
  • string $ip: an IP address
  • mixed $status: A comment status value, or FALSE to not filter on status (default: Comment::STATUS_APPROVED)
static method count_by_name (line 553)

static count_by_name

returns the number of comments attributed to the specified name

  • return: a count of the comments from the specified name
  • access: public
static int count_by_name ([string $name = ''], [mixed $status = Comment::STATUS_APPROVED])
  • string $name: a commenter's name
  • mixed $status: A comment status value, or FALSE to not filter on status (default: Comment::STATUS_APPROVED)
static method count_by_slug (line 616)

static count_by_slug

returns the number of comments attached to the specified post

  • return: a count of the comments attached to the specified post
  • access: public
static int count_by_slug ([string $slug = ''], [mixed $status = Comment::STATUS_APPROVED])
  • string $slug: a post slug
  • mixed $status: A comment status value, or FALSE to not filter on status (default: Comment::STATUS_APPROVED)
static method count_by_url (line 585)

static count_by_url

returns the number of comments attributed to the specified URL

  • return: a count of the comments from the specified URL
  • access: public
static int count_by_url ([string $url = ''], [mixed $status = Comment::STATUS_APPROVED])
  • string $url: a URL
  • mixed $status: a comment status value, or FALSE to not filter on status (default: Comment::STATUS_APPROVED)
static method count_total (line 540)

static count_total

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

  • return: a count of the comments based on the specified status and type
  • access: public
static int count_total ([mixed $status = Comment::STATUS_APPROVED], [mixed $type = Comment::COMMENT])
  • mixed $status: A comment status value, or FALSE to not filter on status (default: Comment::STATUS_APPROVED)
  • mixed $type: A comment type value, or FALSE to not filter on type (default: Comment::COMMENT)
static method delete_by_status (line 667)

static delete_by_status

delete all the comments and commentinfo for comments with this status

  • access: public
static void delete_by_status (mixed $status)
  • mixed $status: a comment status ID or name
static method delete_these (line 267)

Deletes comments from the database

  • access: public
static void delete_these (mixed $comments)
  • mixed $comments: Comments to delete. An array of or a single ID/Comment object
static method get (line 24)

function get

Returns requested comments

  • return:

    An array of Comment objects, one for each query result

    1.  $commentscomments::getarray "author" => "skippy" ) );
    2.  $commentscomments::getarray "slug" => "first-post""status" => "1""orderby" => "date ASC" ) );

  • access: public
static array get ([array $paramarray = array()])
  • array $paramarray: An associated array of parameters, or a querystring
static method moderate_these (line 309)

Changes the status of comments

  • access: public
static void moderate_these (mixed $comments, [ $status = Comment::STATUS_UNAPPROVED])
  • mixed $comments: Comment IDs to moderate. May be a single ID, or an array of IDs
  • $status
static method search_to_get (line 687)

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.

  • return: An associative array which can be passed to Comments::get()
  • access: public
static array search_to_get (string $search_string)
  • string $search_string: The search string
static method set (line 647)

static set

returns the number of document

  • return: the number of document or null
  • access: public
static int set (array $params)
  • array $params: of params
delete (line 521)

function delete

Deletes all comments in this object

  • access: public
void delete ()
only (line 485)

function only

returns all of the comments from the current Comments object of the specified type

  1. $tb$comments->only'trackbacks' )

  • return: an array of Comment objects of the specified type
  • access: public
array only ([ $what = 'approved'])
  • $what
__get (line 502)

function __get

Implements custom object properties

  • return: The requested field value
  • access: public
mixed __get (string $name)
  • string $name: Name of property to return

Inherited Methods

Inherited From ArrayObject (Internal Class)

constructor __construct ( $array )
append ( $value )
asort ( )
count ( )
exchangeArray ( $array )
getArrayCopy ( )
getFlags ( )
getIterator ( )
getIteratorClass ( )
ksort ( )
natcasesort ( )
natsort ( )
offsetExists ( $index )
offsetGet ( $index )
offsetSet ( $index, $newval )
offsetUnset ( $index )
setFlags ( $flags )
setIteratorClass ( $iteratorClass )
uasort ( $cmp_function )
uksort ( $cmp_function )
Class Constants

Inherited Constants

Inherited from ArrayObject (Internal Class)

ARRAY_AS_PROPS = 2
STD_PROP_LIST = 1

Documentation generated on Thu, 30 Oct 2008 20:31:04 +0100 by phpDocumentor 1.3.2