5 # Part of the Collection Workflow Integration System (CWIS) 6 # Copyright 2002-2016 Edward Almasy and Internet Scout Research Group 7 # http://scout.wisc.edu/cwis/ 16 # ---- PUBLIC INTERFACE -------------------------------------------------- 30 $DB->Query(
"INSERT INTO Topics (TopicId) VALUES (NULL)");
33 $TopicId =
$DB->LastInsertId();
36 $Topic =
new Topic($TopicId);
45 # decrement the topic count for the parent forum 47 $Forum->TopicCount($Forum->TopicCount() - 1);
49 $this->DB->Query(
"SELECT * FROM Messages WHERE ParentId = ".
50 $this->
Id().
" AND ParentType = 1");
52 # delete messages associated with this topic 53 while ($Entry = $this->DB->FetchRow())
55 $Message =
new Message($Entry[
"MessageId"]);
59 # delete this topic itself 76 # query for messages associated with this topic 78 SELECT * FROM Messages 79 WHERE ParentId = '".addslashes($this->
Id()).
"' 81 ORDER BY DatePosted ASC");
83 # create Message objects from the results 84 while (FALSE !== ($Row = $this->DB->FetchRow()))
86 $Messages[$Row[
"MessageId"]] =
new Message($Row[
"MessageId"]);
116 $CreatorName =
new CWUser($UserId);
117 return $CreatorName->Get(
"UserName");
135 $CreatorName =
new CWUser($UserId);
136 return $CreatorName->Get(
"EMail");
170 return $this->
UpdateValue(
"DateCreated", $NewValue);
202 return $this->
UpdateValue(
"MessageCount", $NewValue);
CreatorId($NewValue=DB_NOVALUE)
Get or set the creator of this topic.
ForumId($NewValue=DB_NOVALUE)
Set or modify the forum with which this topic is associated.
Abstraction for forum messages and resource comments.
UpdateValue($ColumnName, $NewValue=DB_NOVALUE)
Convenience function to supply parameters to Database::UpdateValue().
A converastion forum which includes topics and messages.
SQL database abstraction object with smart query caching.
CreatorEmail()
Get the e-mail address of the user who created this topic.
CreatorName()
Get the CWIS name of the user who created this topic.
Abstraction for topics within a Forum.
TopicName($NewValue=DB_NOVALUE)
Get or modify the name of this topic.
CWIS-specific user factory class.
static Create()
Create an empty new topic.
DateCreated($NewValue=DB_NOVALUE)
Get or set the creation date of this topic.
Delete()
Remove this topic from the database, deleting the underlying messages.
Common base class for persistent items store in database.
ViewCount($NewValue=DB_NOVALUE)
Get or set the view count for this topic.
TopicId()
Get the ID of this topic.
GetMessageList()
Get the list of messages in this topic.
MessageCount($NewValue=DB_NOVALUE)
Get or set the message count for this topic.
CWIS-specific user class.