4 # FILE: MessageFactory.php
6 # Part of the Collection Workflow Integration System (CWIS)
7 # Copyright 2011-2013 Edward Almasy and Internet Scout Research Group
8 # http://scout.wisc.edu/cwis
18 # ---- PUBLIC INTERFACE --------------------------------------------------
26 $this->
ItemFactory(
"Message",
"Messages",
"MessageId",
"Subject");
42 # retrieve message IDs posted by specified user
43 $this->DB->Query(
"SELECT MessageId FROM Messages"
44 .
" WHERE PosterId = ".intval($UserId)
45 .
" ORDER BY DatePosted DESC"
46 .($Count ?
" LIMIT ".intval($Count) :
""));
47 $MessageIds = $this->DB->FetchColumn(
"MessageId");
49 # load messages based on message IDs
51 foreach ($MessageIds as $Id)
53 $Messages[$Id] =
new Message($Id);
56 # return array of message IDs to caller
62 # ---- PRIVATE INTERFACE -------------------------------------------------
Abstraction for forum messages and resource comments.
MessageFactory()
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.
ItemFactory($ItemClassName, $ItemTableName, $ItemIdFieldName, $ItemNameFieldName=NULL, $OrderOpsAllowed=FALSE, $SqlCondition=NULL)
Class constructor.