Squiz Matrix
4.12.2
|
Public Member Functions | |
Messaging_Service () | |
getLogTypes ($msg_type) | |
openQueue () | |
closeQueue () | |
abortQueue () | |
enqueueMessage ($message) | |
queueContents () | |
openLog () | |
closeLog () | |
abortLog () | |
logMessage ($message) | |
logContents () | |
newMessage ($to=Array(), $type='', $reps=Array()) | |
send ($msgs) | |
getMessages ($userid, $type=NULL, $statii=Array(), $messageids=Array(), $from=NULL, $to=NULL, $get_user_name=NULL, $parameters=Array(), $max_msgs=0, $count_only=FALSE) | |
getLogs ($type, $parameters=Array()) | |
getMessageById ($messageid) | |
queueEmail ($from, $to, $subject, $body, $reply_to='') | |
sendQueuedEmails () | |
formatEmail ($body, &$user, $type='text') | |
Public Member Functions inherited from MySource_Object | |
MySource_Object () | |
__sleep () | |
__wakeup () | |
Static Public Member Functions | |
static | sortMessages ($a, $b) |
Data Fields | |
$_levels | |
$_emails = Array() | |
$sending_queue = FALSE | |
Data Fields inherited from MySource_Object | |
$_tmp | |
Definition at line 43 of file messaging_service.inc.
abortLog | ( | ) |
Aborts a log or nested log, and removes it's messages from the log
Definition at line 324 of file messaging_service.inc.
abortQueue | ( | ) |
Aborts a queue or nested queue, and removes it's messages from the queue
Definition at line 218 of file messaging_service.inc.
closeLog | ( | ) |
Closes a log or nested log, and add's it messages to the main log If the last log is closed, the messages in the log are sent
Definition at line 286 of file messaging_service.inc.
closeQueue | ( | ) |
Closes a queue or nested queue, and add's it messages to the main queue If the last queue is closed, the messages in the queue are sent
Definition at line 193 of file messaging_service.inc.
enqueueMessage | ( | $message | ) |
Adds an internal message into the queue
It takes Internal_Message object as an argument
object | $message | the message to add to the queue |
Definition at line 237 of file messaging_service.inc.
formatEmail | ( | $body, | |
& | $user, | ||
$type = 'text' |
|||
) |
formats the body of an email with a header and a footer
string | $body | the email body |
mixed | &$user | either the user object or a string containing the user's name that the email is intended for |
string | $type | the type of the email (text or html) |
Definition at line 847 of file messaging_service.inc.
getLogs | ( | $type, | |
$parameters = Array() |
|||
) |
Get logged messages of the passed typed
This is just a cut down version of getMessages so you can get logs without having to call getMessages will a bunch of array and NULL arguments
string | $type | the type of the message eg. asset.attributes |
array | $parameters | can limit returned messages to those with these params set |
Definition at line 633 of file messaging_service.inc.
getLogTypes | ( | $msg_type | ) |
Returns the log types that are to be used for the passed message type Log Types: 'log_to_file', 'log_to_db', 'send_mail' ('string'=>bool) array of log type => boolen for whether to use or not
string | $msg_type | the message type (eg 'asset.workflow.announce.approve') |
Definition at line 97 of file messaging_service.inc.
getMessageById | ( | $messageid | ) |
Returns the message object for the passed id
It returns NULL on error or Internal_Message
int | $messageid | id of the message the you want to get |
Definition at line 650 of file messaging_service.inc.
getMessages | ( | $userid, | |
$type = NULL , |
|||
$statii = Array() , |
|||
$messageids = Array() , |
|||
$from = NULL , |
|||
$to = NULL , |
|||
$get_user_name = NULL , |
|||
$parameters = Array() , |
|||
$max_msgs = 0 , |
|||
$count_only = FALSE |
|||
) |
Gets all messages for the passed userid
string | $userid | id of the user you are fetching messages for (0 = system, NULL = any user except system) |
string | $type | the type of the message eg. asset.workflow or asset.attributes.* |
array | $statii | can limit returned messages to those with a status in this array |
array | $messageids | can limit returned messages to those with a messageid in this array |
int | $from | timestamp that every msg returned must be this time or after (NULL to ignore) |
int | $to | timestamp that every msg returned must be this time or before (NULL to ignore) |
string | $get_user_name | [name|short_name], used to return the name/short_name of the from user with the return, which will be returned in the field 'from_name'. (NULL to ignore) |
array | $parameters | can limit returned messages to those with these params set |
int | $max_msgs | the maximum number of messages |
boolean | $count_only | whether to only get a count of the number of messages or not. defaults to FALSE |
Definition at line 450 of file messaging_service.inc.
logContents | ( | ) |
Returns the messages in the current log or nested log (array of object Internal_Message)
Only the contents of the most inside nested log are available from this function
Definition at line 358 of file messaging_service.inc.
logMessage | ( | $message | ) |
Adds an internal message into the log
It takes Internal_Message object as an argument
object | $message | the message to add to the log |
Definition at line 343 of file messaging_service.inc.
Constructor
Definition at line 80 of file messaging_service.inc.
newMessage | ( | $to = Array() , |
|
$type = '' , |
|||
$reps = Array() |
|||
) |
Creates and returns a new internal message
Some variables of a message can be passed in for simple messages but messages that want to utilise other options need to set these manually so as to not clutter this functions
array | $to | an array of user or group IDs to send this message to (integers) |
string | $type | the log type of this message (if any) |
array | $reps | the main body replacement |
Definition at line 382 of file messaging_service.inc.
openLog | ( | ) |
Opens a new log or nested log Note that this function really just updates how many logs are open
Definition at line 272 of file messaging_service.inc.
openQueue | ( | ) |
Opens a new queue or nested queue Note that this function really just updates how many queues are open
Definition at line 179 of file messaging_service.inc.
queueContents | ( | ) |
Returns the messages in the current queue or nested queue (array of object Internal_Message)
Only the contents of the most inside nested queue are available from this function
Definition at line 255 of file messaging_service.inc.
queueEmail | ( | $from, | |
$to, | |||
$subject, | |||
$body, | |||
$reply_to = '' |
|||
) |
queue up an email to send at the conclusion of the script
string | $from | the assetid of the user to send from (0 for system) |
string | $to | the assetid of the user to send to (0 for system) |
string | $subject | subject of the internal message |
string | $body | body of the internal message |
Definition at line 688 of file messaging_service.inc.
send | ( | $msgs | ) |
Sends all messages passed in, doing some amalgamation of msg bodies for same user and same subject
array | $msgs | an array of Internal_Message to send |
Definition at line 405 of file messaging_service.inc.
sendQueuedEmails | ( | ) |
|
static |
Sorts two messages based on the sent date (newest message first)
array | $a | the first message to compare |
array | $b | the second message to compare |
Definition at line 669 of file messaging_service.inc.
$_levels |
Definition at line 51 of file messaging_service.inc.