Search:

# CWIS Developers Documentation

# Topic Class Reference

Abstraction for topics within a Forum. More...

## Public Attributes
const | OK = 0
const | NONEXISTENT = 1
## Setup/Initialization/Destruction
| Topic ($TopicId=NULL)
| Object Constructor.
| Delete ()
| Remove this topic from the database, deleting the underlying messages.
## Accessors
| GetMessageList ()
| Get a list of messages in this topic.
| TopicId ()
| Get the Id of this topic.
| CreatorName ()
| Get the CWIS name of the user who created this topic.
| CreatorEmail ()
| Get the email address of the user who created this topic.
| ForumId ($NewValue=DB_NOVALUE)
| Set or modify the forum with which this topic is associated.
| CreatorId ($NewValue=DB_NOVALUE)
| Get or Set the creator of this topic.
| DateCreated ($NewValue=DB_NOVALUE)
| Get or set set the creation date of this topic.
| TopicName ($NewValue=DB_NOVALUE)
| Get or modify the name of this topic.
| ViewCount ($NewValue=DB_NOVALUE)
| Get or set the viewcount for this topic.
| MessageCount ($NewValue=DB_NOVALUE)
| Get or set the messagecount for this topic.
| GetErrorStatus ()
| Retrieve the error status.

List of all members.

## Detailed Description

Abstraction for topics within a Forum.

Definition at line 29 of file Topic.php.

## Member Function Documentation

Topic::CreatorEmail | ( |  | ) |

Get the email address of the user who created this topic.

Returns:
  Email address of the user who created this topic

Definition at line 146 of file Topic.php.

References CreatorId().

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

Get or Set the creator of this topic.

Parameters:

  | NewValue | (OPTIONAL)

Returns:
  The current CreatorId

Definition at line 164 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:
  CWIS name of the user who created this topic

Definition at line 136 of file Topic.php.

References CreatorId().

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

Get or set set the creation date of this topic.

Parameters:

  | NewValue | (OPTIONAL)

Returns:
  The current creation date

Definition at line 171 of file Topic.php.

Topic::Delete | ( |  | ) |

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

Definition at line 84 of file Topic.php.

References OK, and TopicId().

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

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

Parameters:

  | NewValue | (OPTIONAL)

Returns:
  The current ForumId

Definition at line 157 of file Topic.php.

Topic::GetErrorStatus | ( |  | ) |

Retrieve the error status.

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

Definition at line 198 of file Topic.php.

Topic::GetMessageList | ( |  | ) |

Get a list of messages in this topic.

Returns:
  An array of Message objects, indexed by message Id

Definition at line 110 of file Topic.php.

References TopicId().

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

Get or set the messagecount for this topic.

Parameters:

  | NewValue | (OPTIONAL)

Returns:
  The current message count

Definition at line 192 of file Topic.php.

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

Object Constructor.

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

Parameters:

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

Definition at line 48 of file Topic.php.

References NONEXISTENT, OK, and TopicId().

Topic::TopicId | ( |  | ) |

Get the Id of this topic.

Returns:
  Id of this topic

Definition at line 130 of file Topic.php.

Referenced by Delete(), GetMessageList(), and Topic().

Here is the caller graph for this function:

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

Get or modify the name of this topic.

Parameters:

  | NewValue | (OPTIONAL)

Returns:
  The current name of this topic

Definition at line 178 of file Topic.php.

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

Get or set the viewcount for this topic.

Parameters:

  | NewValue | (OPTIONAL)

Returns:
  The current viewcount

Definition at line 185 of file Topic.php.

## Member Data Documentation

const Topic::NONEXISTENT = 1

Definition at line 36 of file Topic.php.

Referenced by Topic().

const Topic::OK = 0

Definition at line 35 of file Topic.php.

Referenced by Delete(), and Topic().

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

- Topic.php