3 # FILE: MessageFactory.php 5 # Part of the Collection Workflow Integration System (CWIS) 6 # Copyright 2011-2016 Edward Almasy and Internet Scout Research Group 7 # http://scout.wisc.edu/cwis/ 16 # ---- PUBLIC INTERFACE -------------------------------------------------- 26 parent::__construct(
"Message",
"Messages",
"MessageId",
"Subject");
42 # retrieve message IDs posted by specified user 44 if (intval($Count) === 0) {
return $Messages; }
46 $this->DB->Query(
"SELECT MessageId FROM Messages" 47 .
" WHERE PosterId = ".intval($UserId)
48 .
" ORDER BY DatePosted DESC" 49 .($Count ?
" LIMIT ".intval($Count) :
""));
50 $MessageIds = $this->DB->FetchColumn(
"MessageId");
52 # load messages based on message IDs 53 foreach ($MessageIds as $Id)
55 $Messages[$Id] =
new Message($Id);
58 # return array of message IDs to caller 64 # ---- PRIVATE INTERFACE ------------------------------------------------- Abstraction for forum messages and resource comments.
__construct()
Object constructor.
GetMessagesPostedByUser($UserId, $Count=NULL)
Get all messages posted by specified user, in reverse date order.
Common factory class for item manipulation.
Factory for forum messages / resource comments.