CWIS Developer Documentation
Public Member Functions | Static Public Member Functions | List of all members
Forum Class Reference

A converastion forum which includes topics and messages. More...

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

Public Member Functions

 AddTopic ($Author, $TopicName, $Subject, $Body)
 Add topic to forum. More...
 
 PostMessage ($TopicId, $Author, $Subject, $Body)
 Post new message to topic. More...
 
- 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

static DeleteMessage ($MessageId)
 Delete a message from a forum, updating the message counts for the associated forum and topic. 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...
 

Setup/Initialization/Destruction

static Create ($Name, $ModeratorId, $Description=NULL)
 Create a forum. More...
 
 Delete ()
 Remove this forum, deleting all assocated topics and messages. More...
 

Accessors

 ForumId ()
 Get the forum's ID. More...
 
 LastMessageDate ()
 Get the date of the most recent post to the forum. More...
 
 LastMessagePoster ()
 Get the CWIS username of the user with the most recent post. More...
 
 LastMessagePosterEmail ()
 Get the e-mail address of the user with the most recent post. More...
 
 ModeratorName ()
 Get the CWIS username of the forum's moderator. More...
 
 ModeratorEmail ()
 Get the e-mail address of the forum's moderator. More...
 
 GetTopicList ()
 Get the list of the topics in this forum. More...
 
 GetLastMessage ()
 Get the last message posted in the forum. More...
 
 ForumName ($NewValue=DB_NOVALUE)
 Get or modify the forum's name. More...
 
 ForumDescription ($NewValue=DB_NOVALUE)
 Get or modify the forum description. More...
 
 TopicCount ($NewValue=DB_NOVALUE)
 Get or set the forum's topic count. More...
 
 MessageCount ($NewValue=DB_NOVALUE)
 Get or set the forum's message count. More...
 
 ModeratorId ($NewValue=DB_NOVALUE)
 Get or set the forum's moderator. More...
 

Additional Inherited Members

- Public Attributes inherited from Item
const NO_ITEM = -2123456789
 ID value used to indicate no item. 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

A converastion forum which includes topics and messages.

Definition at line 14 of file Forum.php.

Member Function Documentation

Forum::AddTopic (   $Author,
  $TopicName,
  $Subject,
  $Body 
)

Add topic to forum.

Parameters
CWUser$AuthorUser adding new topic.
string$TopicNameName of new topic.
string$SubjectSubject for new topic.
string$BodyText body for new topic.
Returns
int ID of new topic.

Definition at line 304 of file Forum.php.

References Topic\Create(), Item\Id(), PostMessage(), and TopicCount().

static Forum::Create (   $Name,
  $ModeratorId,
  $Description = NULL 
)
static

Create a forum.

Parameters
string$NameName of the forum.
int$ModeratorIdUserId of the forum moderator.
str$DescriptionDescription of the forum (OPTIONAL, defaults to none).
Returns
New forum object.

Definition at line 30 of file Forum.php.

References Item\$DB.

Forum::Delete ( )

Remove this forum, deleting all assocated topics and messages.

Definition at line 84 of file Forum.php.

References Item\Destroy(), and Item\Id().

static Forum::DeleteMessage (   $MessageId)
static

Delete a message from a forum, updating the message counts for the associated forum and topic.

Parameters
int$MessageIdID of the message to delete

Definition at line 351 of file Forum.php.

Forum::ForumDescription (   $NewValue = DB_NOVALUE)

Get or modify the forum description.

Parameters
string$NewValueNew forum description. This parameter is optional.
Returns
Returns the current forum description.

Definition at line 258 of file Forum.php.

References Item\UpdateValue().

Forum::ForumId ( )

Get the forum's ID.

Returns
Returns the forum ID
Deprecated:
Use Id() instead.

Definition at line 108 of file Forum.php.

References Item\Id().

Forum::ForumName (   $NewValue = DB_NOVALUE)

Get or modify the forum's name.

Parameters
string$NewValueNew forum name. This parameter is optional.
Returns
Returns the current forum name.

Definition at line 248 of file Forum.php.

References Item\UpdateValue().

Forum::GetLastMessage ( )

Get the last message posted in the forum.

Returns
Returns a Message object of the last posted message or NULL if there isn't one.

Definition at line 221 of file Forum.php.

References Item\Id(), and Message\PARENTTYPE_TOPIC.

Referenced by LastMessageDate(), LastMessagePoster(), and LastMessagePosterEmail().

Here is the caller graph for this function:

Forum::GetTopicList ( )

Get the list of the topics in this forum.

Returns
Returns an array of topic IDs for this forum's conversations.

Definition at line 201 of file Forum.php.

References Item\Id().

Forum::LastMessageDate ( )

Get the date of the most recent post to the forum.

Returns
Returns the date of the most recent post or "None" for empty forums

Definition at line 118 of file Forum.php.

References GetLastMessage().

Forum::LastMessagePoster ( )

Get the CWIS username of the user with the most recent post.

Returns
Returns the CWIS username of the user with the most recent post.

Definition at line 135 of file Forum.php.

References GetLastMessage().

Forum::LastMessagePosterEmail ( )

Get the e-mail address of the user with the most recent post.

Returns
Returns the e-mail address of the user with the most recent post.

Definition at line 148 of file Forum.php.

References GetLastMessage().

Forum::MessageCount (   $NewValue = DB_NOVALUE)

Get or set the forum's message count.

Parameters
int$NewValueNew forum message count. This parameter is optional.
Returns
Returns the current message count.

Definition at line 278 of file Forum.php.

References Item\UpdateValue().

Referenced by PostMessage().

Here is the caller graph for this function:

Forum::ModeratorEmail ( )

Get the e-mail address of the forum's moderator.

Returns
Returns the e-mail address of the forum's modreator or NULL if there is no such user with the UserId.

Definition at line 182 of file Forum.php.

References ModeratorId().

Forum::ModeratorId (   $NewValue = DB_NOVALUE)

Get or set the forum's moderator.

Parameters
int$NewValueNew forum moderator's user ID. This parameter is optional.
Returns
Returns the CWIS user ID of the forum's moderator.

Definition at line 289 of file Forum.php.

References Item\UpdateValue().

Referenced by ModeratorEmail(), and ModeratorName().

Here is the caller graph for this function:

Forum::ModeratorName ( )

Get the CWIS username of the forum's moderator.

Returns
Returns the CWIS username of the forum's moderator or NULL if there is no such user with the UserId.

Definition at line 162 of file Forum.php.

References ModeratorId().

Forum::PostMessage (   $TopicId,
  $Author,
  $Subject,
  $Body 
)

Post new message to topic.

Parameters
int$TopicIdID of topic.
CWUser$AuthorUser adding new message.
string$SubjectSubject for new message.
string$BodyText body for new message.

Definition at line 326 of file Forum.php.

References Message\Create(), MessageCount(), and Message\PARENTTYPE_TOPIC.

Referenced by AddTopic().

Here is the caller graph for this function:

Forum::TopicCount (   $NewValue = DB_NOVALUE)

Get or set the forum's topic count.

Parameters
int$NewValueNew forum topic count. This parameter is optional.
Returns
Returns the forum's current topic count.

Definition at line 268 of file Forum.php.

References Item\UpdateValue().

Referenced by AddTopic().

Here is the caller graph for this function:


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