MDL-46455 mod_*: added restore mapping to events

This commit is contained in:
Mark Nelson 2015-09-24 17:02:57 -07:00
parent ef15eae433
commit 0bfafc5ba0
170 changed files with 1364 additions and 19 deletions

View file

@ -100,4 +100,9 @@ class attempt_deleted extends \core\event\base {
throw new \coding_exception('The \'attemptid\' must be set in other.');
}
}
public static function get_other_mapping() {
// Can't map the 'attemptid' value.
return false;
}
}

View file

@ -53,5 +53,9 @@ class course_module_viewed extends \core\event\course_module_viewed {
return array($this->courseid, 'scorm', 'pre-view', 'view.php?id=' . $this->contextinstanceid, $this->objectid,
$this->contextinstanceid);
}
public static function get_objectid_mapping() {
return array('db' => 'scorm', 'restore' => 'scorm');
}
}

View file

@ -115,4 +115,11 @@ class interactions_viewed extends \core\event\base {
throw new \coding_exception('The \'instanceid\' must be set in other.');
}
}
public static function get_other_mapping() {
$othermapped = array();
$othermapped['instanceid'] = array('db' => 'scorm', 'restore' => 'scorm');
return $othermapped;
}
}

View file

@ -105,4 +105,11 @@ class report_viewed extends \core\event\base {
throw new \coding_exception('The \'mode\' value must be set in other.');
}
}
public static function get_other_mapping() {
$othermapped = array();
$othermapped['scormid'] = array('db' => 'scorm', 'restore' => 'scorm');
return $othermapped;
}
}

View file

@ -102,4 +102,15 @@ class sco_launched extends \core\event\base {
throw new \coding_exception('The \'loadedcontent\' value must be set in other.');
}
}
public static function get_objectid_mapping() {
return array('db' => 'scorm_scoes', 'restore' => 'scorm_sco');
}
public static function get_other_mapping() {
$othermapped = array();
$othermapped['instanceid'] = array('db' => 'scorm', 'restore' => 'scorm');
return $othermapped;
}
}

View file

@ -118,4 +118,12 @@ class tracks_viewed extends \core\event\base {
throw new \coding_exception('The \'scoid\' value must be set in other.');
}
}
public static function get_other_mapping() {
$othermapped = array();
$othermapped['instanceid'] = array('db' => 'scorm', 'restore' => 'scorm');
$othermapped['scoid'] = array('db' => 'scorm_scoes', 'restore' => 'scorm_scoe');
return $othermapped;
}
}

View file

@ -112,4 +112,11 @@ class user_report_viewed extends \core\event\base {
throw new \coding_exception('The \'instanceid\' value must be set in other.');
}
}
public static function get_other_mapping() {
$othermapped = array();
$othermapped['instanceid'] = array('db' => 'scorm', 'restore' => 'scorm');
return $othermapped;
}
}