CWIS Developer Documentation
Public Attributes | List of all members
Message Class Reference

Abstraction for forum messages and resource comments. More...

Inheritance diagram for Message:
Inheritance graph
[legend]
Collaboration diagram for Message:
Collaboration graph
[legend]

Public Attributes

const PARENTTYPE_TOPIC = 1
 
const PARENTTYPE_RESOURCE = 2
 
- Public Attributes inherited from Item
const NO_ITEM = -2123456789
 ID value used to indicate no item. More...
 

Setup/Initialization/Destruction

static Create ()
 Create an empty message object. More...
 
 Delete ()
 Delete this message from the underlying database. More...
 

Accessors

 MessageId ()
 Get this message's messageId. More...
 
 PosterName ()
 Get the CWIS username of the most recent poster. More...
 
 PosterEmail ()
 Get the email address of the most recent poster. More...
 
 EditorId ($NewValue=DB_NOVALUE)
 Get the CWIS user ID of the most recent editor. More...
 
 ParentId ($NewValue=DB_NOVALUE)
 Get or set the ParentId. More...
 
 ParentType ($NewValue=DB_NOVALUE)
 Get or set the ParentType. More...
 
 DatePosted ($NewValue=DB_NOVALUE)
 Get or set the date posted. More...
 
 DateEdited ($NewValue=DB_NOVALUE)
 Get or set the date the message was last edited. More...
 
 PosterId ($NewValue=DB_NOVALUE)
 Get or set the poster id (e.g., the author) for this message. More...
 
 Subject ($NewValue=DB_NOVALUE)
 Get or set the message subject. More...
 
 Body ($NewValue=DB_NOVALUE)
 Get or set the message body. More...
 

Additional Inherited Members

- Public Member Functions inherited from Item
 __construct ($Id)
 Constructor, used to load existing items. More...
 
 Destroy ()
 Destroy item. More...
 
 Delete ()
 Destroy item. More...
 
 Id ()
 Get item ID. More...
 
 Name ($NewValue=DB_NOVALUE)
 Get/set name of item. More...
 
 DateCreated ($NewValue=DB_NOVALUE)
 Get/set when item was created. More...
 
 CreatedBy ($NewValue=DB_NOVALUE)
 Get/set ID of user who created the item. More...
 
 DateLastModified ($NewValue=DB_NOVALUE)
 Get/set when item was last modified. More...
 
 LastModifiedBy ($NewValue=DB_NOVALUE)
 Get/set ID of user who last modified the item. More...
 
- Static Public Member Functions inherited from Item
static GetCanonicalId ($Id)
 Normalize item ID to canonical form. More...
 
static ItemExists ($Id)
 Check whether an item exists with the specified ID. More...
 
- Protected Member Functions inherited from Item
 UpdateValue ($ColumnName, $NewValue=DB_NOVALUE)
 Convenience function to supply parameters to Database::UpdateValue(). More...
 
 UpdateDateValue ($ColumnName, $NewValue=DB_NOVALUE)
 Convenience function to supply parameters to Database::UpdateValue(), with preprocessing of new values to convert them into an SQL-compatible date format. More...
 
- Static Protected Member Functions inherited from Item
static CreateWithValues ($Values)
 Create a new item, using specified initial database values. More...
 
static SetDatabaseAccessValues ($ClassName)
 Set the database access values (table name, ID column name, name column name) for specified class. More...
 
- Protected Attributes inherited from Item
 $DB
 
 $Id
 
 $ItemIdColumnName
 
 $ItemNameColumnName
 
 $ItemTableName
 
 $ValueCache = array()
 
- Static Protected Attributes inherited from Item
static $ItemIdColumnNames
 
static $ItemNameColumnNames
 
static $ItemTableNames
 

Detailed Description

Abstraction for forum messages and resource comments.

Definition at line 14 of file Message.php.

Member Function Documentation

Message::Body (   $NewValue = DB_NOVALUE)

Get or set the message body.

Parameters
string$NewValueNew body text. (OPTIONAL)
Returns
string Message body.

Definition at line 179 of file Message.php.

References Item\UpdateValue().

static Message::Create ( )
static

Create an empty message object.

Returns
The message just created.

Definition at line 28 of file Message.php.

References Item\$DB.

Referenced by Forum\PostMessage().

Here is the caller graph for this function:

Message::DateEdited (   $NewValue = DB_NOVALUE)

Get or set the date the message was last edited.

Parameters
string$NewValueNew edit date. (OPTIONAL)
Returns
string Date the message was last edited.

Definition at line 149 of file Message.php.

References Item\UpdateValue().

Message::DatePosted (   $NewValue = DB_NOVALUE)

Get or set the date posted.

Parameters
string$NewValueNew posting date. (OPTIONAL)
Returns
string Posting date.

Definition at line 139 of file Message.php.

References Item\UpdateValue().

Message::Delete ( )

Delete this message from the underlying database.

Definition at line 45 of file Message.php.

References Item\Destroy().

Message::EditorId (   $NewValue = DB_NOVALUE)

Get the CWIS user ID of the most recent editor.

Parameters
int$NewValueNew editor ID. (OPTIONAL)
Returns
int CWIS user ID of the most recent editor.

Definition at line 105 of file Message.php.

References Item\UpdateValue().

Message::MessageId ( )

Get this message's messageId.

Returns
int Message ID.

Definition at line 59 of file Message.php.

References Item\Id().

Message::ParentId (   $NewValue = DB_NOVALUE)

Get or set the ParentId.

For forum posts, the ParentId is a TopicId. For resource comments, the ParentId is the ResourceId.

Parameters
int$NewValueNew value to set (OPTIONAL)
Returns
The current ParentId

Definition at line 117 of file Message.php.

References Item\UpdateValue().

Message::ParentType (   $NewValue = DB_NOVALUE)

Get or set the ParentType.

Parent Type = 1 for forum posts and Parent Type = 2 for resource comments

Parameters
int$NewValueNew parent type. (OPTIONAL)
Returns
int Current parent type.

Definition at line 129 of file Message.php.

References Item\UpdateValue().

Message::PosterEmail ( )

Get the email address of the most recent poster.

Returns
string Email address of the most recent poster.

Definition at line 86 of file Message.php.

References PosterId().

Message::PosterId (   $NewValue = DB_NOVALUE)

Get or set the poster id (e.g., the author) for this message.

Parameters
int$NewValueNew poster ID. (OPTIONAL)
Returns
int ID number of this message's author.

Definition at line 159 of file Message.php.

References Item\UpdateValue().

Referenced by PosterEmail(), and PosterName().

Here is the caller graph for this function:

Message::PosterName ( )

Get the CWIS username of the most recent poster.

Returns
string CWIS username of the most recent poster.

Definition at line 68 of file Message.php.

References PosterId().

Message::Subject (   $NewValue = DB_NOVALUE)

Get or set the message subject.

Parameters
string$NewValueNew subject text. (OPTIONAL)
Returns
string Message subject.

Definition at line 169 of file Message.php.

References Item\UpdateValue().

Member Data Documentation

const Message::PARENTTYPE_RESOURCE = 2

Definition at line 17 of file Message.php.

const Message::PARENTTYPE_TOPIC = 1

Definition at line 16 of file Message.php.

Referenced by Forum\GetLastMessage(), and Forum\PostMessage().


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