MDL-36941 core: alter events to use new table structure

This commit is contained in:
Mark Nelson
2018-03-23 09:27:57 +08:00
parent ee14412e21
commit 4cd439887a
3 changed files with 18 additions and 32 deletions
+3 -5
View File
@@ -46,7 +46,7 @@ class message_viewed extends base {
* Init method.
*/
protected function init() {
$this->data['objecttable'] = 'message_read';
$this->data['objecttable'] = 'message_user_actions';
$this->data['crud'] = 'c';
$this->data['edulevel'] = self::LEVEL_OTHER;
}
@@ -97,15 +97,13 @@ class message_viewed extends base {
}
public static function get_objectid_mapping() {
// Messages are not backed up, so no need to map them.
return array('db' => 'message_read', 'restore' => base::NOT_MAPPED);
return array('db' => 'message_user_actions', 'restore' => base::NOT_MAPPED);
}
public static function get_other_mapping() {
// Messages are not backed up, so no need to map them on restore.
$othermapped = array();
// The messages table could vary for older events - so cannot be mapped.
$othermapped['messageid'] = array('db' => base::NOT_MAPPED, 'restore' => base::NOT_MAPPED);
$othermapped['messageid'] = array('db' => 'messages', 'restore' => base::NOT_MAPPED);
return $othermapped;
}
}