Open Monograph Press  1.1
 All Classes Namespaces Functions Variables Groups Pages
EventLogEntry.inc.php
1 <?php
2 
17 // Information Center events
18 define('SUBMISSION_LOG_NOTE_POSTED', 0x01000000);
19 define('SUBMISSION_LOG_MESSAGE_SENT', 0x01000001);
20 
21 class EventLogEntry extends DataObject {
25  function EventLogEntry() {
26  parent::DataObject();
27  }
28 
29 
30  //
31  // Get/set methods
32  //
33 
38  function getUserId() {
39  return $this->getData('userId');
40  }
41 
46  function setUserId($userId) {
47  return $this->setData('userId', $userId);
48  }
49 
54  function getDateLogged() {
55  return $this->getData('dateLogged');
56  }
57 
62  function setDateLogged($dateLogged) {
63  return $this->setData('dateLogged', $dateLogged);
64  }
65 
70  function getIPAddress() {
71  return $this->getData('ipAddress');
72  }
73 
78  function setIPAddress($ipAddress) {
79  return $this->setData('ipAddress', $ipAddress);
80  }
81 
86  function getEventType() {
87  return $this->getData('eventType');
88  }
89 
94  function setEventType($eventType) {
95  return $this->setData('eventType', $eventType);
96  }
97 
102  function getAssocType() {
103  return $this->getData('assocType');
104  }
105 
110  function setAssocType($assocType) {
111  return $this->setData('assocType', $assocType);
112  }
113 
118  function getAssocId() {
119  return $this->getData('assocId');
120  }
121 
126  function setAssocId($assocId) {
127  return $this->setData('assocId', $assocId);
128  }
129 
134  function getMessage() {
135  return $this->getData('message');
136  }
137 
142  function setMessage($message) {
143  return $this->setData('message', $message);
144  }
145 
150  function getIsTranslated() {
151  return $this->getData('isTranslated');
152  }
153 
158  function setIsTranslated($isTranslated) {
159  return $this->setData('isTranslated', $isTranslated);
160  }
161 
166  function getTranslatedMessage($locale = null) {
167  $message = $this->getMessage();
168  // If it's already translated, just return the message.
169  if ($this->getIsTranslated()) return $message;
170 
171  // Otherwise, translate it and include parameters.
172  if ($locale === null) $locale = AppLocale::getLocale();
173 
174  $params = array_merge($this->_data, $this->getParams());
175  unset($params['params']); // Clean up for translate call
176  return __($message, $params, $locale);
177  }
178 
183  function getParams() {
184  return $this->getData('params');
185  }
186 
191  function setParams($params) {
192  return $this->setData('params', $params);
193  }
194 
199  function getUserFullName() {
200  $userFullName =& $this->getData('userFullName');
201  if(!isset($userFullName)) {
202  $userDao = DAORegistry::getDAO('UserDAO');
203  $userFullName = $userDao->getUserFullName($this->getUserId(), true);
204  }
205 
206  return ($userFullName ? $userFullName : '');
207  }
208 
213  function getUserEmail() {
214  $userEmail =& $this->getData('userEmail');
215 
216  if(!isset($userEmail)) {
217  $userDao = DAORegistry::getDAO('UserDAO');
218  $userEmail = $userDao->getUserEmail($this->getUserId(), true);
219  }
220 
221  return ($userEmail ? $userEmail : '');
222  }
223 }
224 
225 ?>
static & getDAO($name, $dbconn=null)
getTranslatedMessage($locale=null)
setIsTranslated($isTranslated)
setEventType($eventType)
setAssocType($assocType)
static getLocale()
& getData($key, $locale=null)
Describes an entry in the event log.
Any class with an associated DAO should extend this class.
setData($key, $value, $locale=null)
setIPAddress($ipAddress)
setDateLogged($dateLogged)