Open Journal Systems  3.3.0
SubmissionFileLog.inc.php
1 <?php
2 
16 import('lib.pkp.classes.log.SubmissionLog');
17 
28  static function logEvent($request, $submissionFile, $eventType, $messageKey, $params = array()) {
29  // Create a new entry object
30  $submissionFileEventLogDao = DAORegistry::getDAO('SubmissionFileEventLogDAO'); /* @var $submissionFileEventLogDao SubmissionFileEventLogDAO */
31  $entry = $submissionFileEventLogDao->newDataObject();
32 
33  // Set implicit parts of the log entry
34  $entry->setDateLogged(Core::getCurrentDate());
35 
36  $user = $request->getUser();
37  if ($user) $entry->setUserId($user->getId());
38 
39  $entry->setAssocType(ASSOC_TYPE_SUBMISSION_FILE);
40  $entry->setAssocId($submissionFile->getFileId());
41 
42  // Set explicit parts of the log entry
43  $entry->setEventType($eventType);
44  $entry->setMessage($messageKey);
45  $entry->setParams($params);
46  $entry->setIsTranslated(0); // Legacy for other apps. All messages use locale keys.
47 
48  // Insert the resulting object
49  $submissionFileEventLogDao->insertObject($entry);
50  return $entry;
51  }
52 }
53 
54 
DAORegistry\getDAO
static & getDAO($name, $dbconn=null)
Definition: DAORegistry.inc.php:57
SubmissionLog
Static class for adding / accessing PKP log entries.
Definition: SubmissionLog.inc.php:23
SubmissionFileLog
Static class for adding / accessing submission file log entries.
Definition: SubmissionFileLog.inc.php:18
Core\getCurrentDate
static getCurrentDate($ts=null)
Definition: Core.inc.php:63
SubmissionFileLog\logEvent
static logEvent($request, $submissionFile, $eventType, $messageKey, $params=array())
Definition: SubmissionFileLog.inc.php:28