From 7ff5192437911dc6fbc8e120b5d561e29e62d1a8 Mon Sep 17 00:00:00 2001 From: michael Date: Mon, 15 Dec 2003 13:43:38 +0000 Subject: [PATCH] #3497 changed some method names to more accurately reflect function, and added getList method --- lib/discussions/DiscussionThread.inc | 40 +++++++++++++++++++++++++++++++++++++--- 1 file changed, 37 insertions(+), 3 deletions(-) diff --git a/lib/discussions/DiscussionThread.inc b/lib/discussions/DiscussionThread.inc index df4784f..ed5c795 100644 --- a/lib/discussions/DiscussionThread.inc +++ b/lib/discussions/DiscussionThread.inc @@ -101,11 +101,17 @@ class DiscussionThread { function getNumberOfViews(){ return $this->iNumberOfViews; } - + /** + * Set the total number of times the thread was viewed + */ + function setNumberOfViews($iValue) { + $this->iNumberOfViews = $iValue; + } + /** * Increment the total number of times the thread was viewed */ - function setNumberOfViews(){ + function incrementNumberOfViews() { $this->iNumberOfViews += 1; } @@ -119,9 +125,15 @@ class DiscussionThread { /** * Increment the total number of replies (comments) in a thread */ - function setNumberOfReplies(){ + function incrementNumberOfReplies(){ $this->iNumberOfReplies += 1; } + /** + * Set the total number of number of replies (comments) in a thread + */ + function setNumberOfReplies($iValue){ + $this->iNumberOfReplies = $iValue; + } /** * Get a All commentID's seperated by a comma "," @@ -155,6 +167,28 @@ class DiscussionThread { } } + /** + * Static function + * Get a list of DiscussionThreads + * + * @param String Where clause (optional) + * + * @return Array array of DiscussionThreads objects, false otherwise + */ + function getList($sWhereClause = null) { + global $default; + $aDiscussionThreads = array(); + $sql = $default->db; + $result = $sql->query("SELECT * FROM " . $default->discussion_threads_table . (isset($sWhereClause) ? " WHERE " . $sWhereClause : "")); + if ($result) { + while ($sql->next_record()) { + $aDiscussionThreads[] = & DiscussionThread::get($sql->f("id")); + } + return $aDiscussionThreads; + } + return false; + } + function getThreadIDforDoc($iDocumentID){ global $default; $sql = $default->db; -- libgit2 0.21.4