CWIS Developer Documentation

- Home
- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Attributes | List of all members
Topic Class Reference

Abstraction for topics within a Forum. More...

## Public Attributes
const | OK = 0
const | NONEXISTENT = 1

## Setup/Initialization/Destruction
| __construct ($TopicId=NULL)
| Object Constructor. More...
| Delete ()
| Remove this topic from the database, deleting the underlying messages. More...

## Accessors
| GetMessageList ()
| Get the list of messages in this topic. More...
| TopicId ()
| Get the ID of this topic. More...
| CreatorName ()
| Get the CWIS name of the user who created this topic. More...
| CreatorEmail ()
| Get the e-mail address of the user who created this topic. More...
| ForumId ($NewValue=DB_NOVALUE)
| Set or modify the forum with which this topic is associated. More...
| CreatorId ($NewValue=DB_NOVALUE)
| Get or set the creator of this topic. More...
| DateCreated ($NewValue=DB_NOVALUE)
| Get or set the creation date of this topic. More...
| TopicName ($NewValue=DB_NOVALUE)
| Get or modify the name of this topic. More...
| ViewCount ($NewValue=DB_NOVALUE)
| Get or set the view count for this topic. More...
| MessageCount ($NewValue=DB_NOVALUE)
| Get or set the message count for this topic. More...
| GetErrorStatus ()
| Retrieve the error status of the object. More...

## Detailed Description

Abstraction for topics within a Forum.

Definition at line 14 of file Topic.php.

## Constructor & Destructor Documentation

Topic::__construct | ( |  | $TopicId = `NULL` | ) |

Object Constructor.

After constructing the object, be sure to call GetErrorStatus() and verify that it returns Topic::OK.

Parameters

  int | $TopicId | The Id desired from the database, or -1 to generate a a new topic

See also
  GetErrorStatus()

Definition at line 32 of file Topic.php.

References TopicId().

## Member Function Documentation

Topic::CreatorEmail | ( |  | ) |

Get the e-mail address of the user who created this topic.

Returns
  Returns the e-mail address of the user who created this topic.

Definition at line 144 of file Topic.php.

References CreatorId().

Topic::CreatorId | ( |  | $NewValue = `DB_NOVALUE` | ) |

Get or set the creator of this topic.

Parameters

  int | $NewValue | User ID of the creator of this topic. This parameter is optional.

Returns
  Returns the user ID of user who created the topic.

Definition at line 167 of file Topic.php.

Referenced by CreatorEmail(), and CreatorName().

Here is the caller graph for this function:

Topic::CreatorName | ( |  | ) |

Get the CWIS name of the user who created this topic.

Returns
  Returns the CWIS name of the user who created this topic.

Definition at line 134 of file Topic.php.

References CreatorId().

Topic::DateCreated | ( |  | $NewValue = `DB_NOVALUE` | ) |

Get or set the creation date of this topic.

Parameters

  string | $NewValue | Creation date of this topic. This parameter is optional.

Returns
  Returns the current creation date.

Definition at line 178 of file Topic.php.

Topic::Delete | ( |  | ) |

Remove this topic from the database, deleting the underlying messages.

Definition at line 71 of file Topic.php.

References ForumId(), and TopicId().

Topic::ForumId | ( |  | $NewValue = `DB_NOVALUE` | ) |

Set or modify the forum with which this topic is associated.

Parameters

  int | $NewValue | ID of the forum with which this topic is associated. This parameter is optional.

Returns
  Returns the ID of the forum currently associated with this topic.

Definition at line 156 of file Topic.php.

Referenced by Delete().

Here is the caller graph for this function:

Topic::GetErrorStatus | ( |  | ) |

Retrieve the error status of the object.

Returns
  Returns Topic::OK if everything worked, something else otherwise.

Definition at line 219 of file Topic.php.

References TopicId().

Topic::GetMessageList | ( |  | ) |

Get the list of messages in this topic.

Returns
  Returns an array of Message objects, indexed by message ID.

Definition at line 101 of file Topic.php.

References TopicId().

Topic::MessageCount | ( |  | $NewValue = `DB_NOVALUE` | ) |

Get or set the message count for this topic.

Parameters

  int | $NewValue | Message count for this topic. This parameter is optional.

Returns
  Returns the current message count.

Definition at line 210 of file Topic.php.

Topic::TopicId | ( |  | ) |

Get the ID of this topic.

Returns
  Returns the ID of this topic.

Definition at line 125 of file Topic.php.

Referenced by __construct(), Delete(), GetErrorStatus(), and GetMessageList().

Here is the caller graph for this function:

Topic::TopicName | ( |  | $NewValue = `DB_NOVALUE` | ) |

Get or modify the name of this topic.

Parameters

  string | $NewValue | Name of this topic. This parameter is optional.

Returns
  Returns the current name of this topic.

Definition at line 188 of file Topic.php.

Topic::ViewCount | ( |  | $NewValue = `DB_NOVALUE` | ) |

Get or set the view count for this topic.

Parameters

  int | $NewValue | View count value for this topic. This parameter is optional.

Returns
  Returns the current view count for this topic.

Definition at line 199 of file Topic.php.

## Member Data Documentation

const Topic::NONEXISTENT = 1

Definition at line 20 of file Topic.php.

const Topic::OK = 0

Definition at line 19 of file Topic.php.

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

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

- objects/Topic.php