Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes

Comment Class Reference

Inheritance diagram for Comment:
Collaboration diagram for Comment:

List of all members.

Public Member Functions

 __construct ($paramarray=array())
 insert ()
 update ()
 delete ()
 __get ($name)
 __set ($name, $value)
 content_type ()
 get_access ($user=null)
 css_class ($append=array())

Static Public Member Functions

static default_fields ()
static get ($id=0)
static create ($paramarray)
static list_comment_types ($refresh=false)
static list_comment_statuses ($refresh=false)
static status_action ($status)
static status ($name)
static status_name ($status)
static type ($name)
static type_name ($type)

Public Attributes

const STATUS_UNAPPROVED = 0
const STATUS_APPROVED = 1
const STATUS_SPAM = 2
const STATUS_DELETED = 3
const COMMENT = 0
const PINGBACK = 1
const TRACKBACK = 2

Static Public Attributes

static $comment_status_list = array()
static $comment_type_list = array()
static $comment_status_actions = array()

Detailed Description

Habari CommentRecord Class

Includes an instance of the CommentInfo class; for holding inforecords about the comment If the Comment object describes an existing user; use the internal info object to get, set, unset and test for existence (isset) of info records $this->info = new CommentInfo ( 1 ); // Info records of comment with id = 1 $this->info->browser_ua= "Netscape 2.0"; // set info record with name "browser_ua" to value "Netscape 2.0" $info_value= $this->info->browser_ua; // get value of info record with name "browser_ua" into variable $info_value if ( isset ($this->info->browser_ua) ) // test for existence of "browser_ua" unset ( $this->info->browser_ua ); // delete "browser_ua" info record

Definition at line 22 of file comment.php.


Constructor & Destructor Documentation

Comment::__construct ( paramarray = array()  ) 

constructor __construct Constructor for the Post class.

Parameters:
array an associative array of initial Post field values.

Definition at line 69 of file comment.php.


Member Function Documentation

Comment::__get ( name  ) 

function __get Overrides QueryRecord __get to implement custom object properties

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

Definition at line 187 of file comment.php.

Comment::__set ( name,
value 
)

function __set Overrides QueryRecord __set to implement custom object properties

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

Definition at line 235 of file comment.php.

Comment::content_type (  ) 

Return the content type of this object

Returns:
string The content type of this object
See also:
IsContent

Implements IsContent.

Definition at line 477 of file comment.php.

static Comment::create ( paramarray  )  [static]

static function create Creates a comment and saves it

Parameters:
array An associative array of comment fields $return Comment The comment object that was created

Definition at line 104 of file comment.php.

Comment::css_class ( append = array()  ) 

Returns a list of CSS classes for the comment

Parameters:
string|array $append Additional classes that should be added to the ones generated
Returns:
string The resultant classes

Definition at line 550 of file comment.php.

static Comment::default_fields (  )  [static]

static function default_fields Returns the defined database columns for a comment

Definition at line 48 of file comment.php.

Referenced by Comments::get().

Comment::delete (  ) 

function delete Deletes this comment

Definition at line 164 of file comment.php.

static Comment::get ( id = 0  )  [static]

static function get Returns a single comment, by ID

$post = Post::get( 10 );

Parameters:
int An ID
Returns:
array A single Comment object

Definition at line 90 of file comment.php.

Referenced by __set(), and AdminCommentsHandler::get_comment().

Comment::get_access ( user = null  ) 

Returns an access Bitmask for the given user on this comment. Read access is determined by the associated post. Update/delete is determined by the comment management tokens.

Parameters:
User $user The user mask to fetch
Returns:
Bitmask

Definition at line 488 of file comment.php.

Comment::insert (  ) 

function insert Saves a new comment to the posts table

Definition at line 115 of file comment.php.

static Comment::list_comment_statuses ( refresh = false  )  [static]

returns an associative array of comment statuses

Parameters:
bool whether to force a refresh of the cached values
Returns:
array An array of comment statuses names => interger values

Definition at line 357 of file comment.php.

Referenced by AdminCommentsHandler::form_comment(), AdminCommentsHandler::get_comment(), AdminCommentsHandler::post_comments(), Comments::search_to_get(), status(), status_action(), and status_name().

static Comment::list_comment_types ( refresh = false  )  [static]

returns an associative array of comment types

Parameters:
bool whether to force a refresh of the cached values
Returns:
array An array of comment type names => integer values

Definition at line 339 of file comment.php.

Referenced by AdminCommentsHandler::post_comments(), Comments::search_to_get(), type(), and type_name().

static Comment::status ( name  )  [static]

returns the integer value of the specified comment status, or false

Parameters:
mixed a comment status name or value
Returns:
mixed an integer or boolean false

Definition at line 404 of file comment.php.

Referenced by __get(), Comments::delete_by_status(), Comments::get(), and AtomHandler::get_comments().

static Comment::status_action ( status  )  [static]

returns the action name of the comment status

Parameters:
mixed a comment status value, or name
Returns:
string a string of the status action, or null

Definition at line 377 of file comment.php.

static Comment::status_name ( status  )  [static]

returns the friendly name of a comment status, or null

Parameters:
mixed a comment status value, or name
Returns:
mixed a string of the status name, or null

Definition at line 422 of file comment.php.

Referenced by __get(), AdminCommentsHandler::form_comment(), and AdminCommentsHandler::get_comment().

static Comment::type ( name  )  [static]

returns the integer value of the specified comment type, or false

Parameters:
mixed a comment type name or number
Returns:
mixed an integer or boolean false

Definition at line 440 of file comment.php.

Referenced by __get(), content_type(), and Comments::get().

static Comment::type_name ( type  )  [static]

returns the friendly name of a comment type, or null

Parameters:
mixed a comment type number, or name
Returns:
mixed a string of the comment type, or null

Definition at line 458 of file comment.php.

Referenced by __get(), and content_type().

Comment::update (  ) 

function update Updates an existing comment in the posts table

Definition at line 140 of file comment.php.


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