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

@ -67,4 +67,8 @@ class course_module_viewed extends \core\event\course_module_viewed {
throw new \coding_exception('Other must contain the key viewed.');
}
}
public static function get_objectid_mapping() {
return array('db' => 'survey', 'restore' => 'survey');
}
}

View file

@ -104,4 +104,15 @@ class report_downloaded extends \core\event\base {
throw new \coding_exception('The \'type\' value must be set in other.');
}
}
public static function get_objectid_mapping() {
return array('db' => 'survey', 'restore' => 'survey');
}
public static function get_other_mapping() {
$othermapped = array();
$othermapped['groupid'] = array('db' => 'groups', 'restore' => 'group');
return $othermapped;
}
}

View file

@ -93,4 +93,15 @@ class report_viewed extends \core\event\base {
return array($this->courseid, "survey", "view report", "report.php?id=" . $this->contextinstanceid, $this->objectid,
$this->contextinstanceid);
}
public static function get_objectid_mapping() {
return array('db' => 'survey', 'restore' => 'survey');
}
public static function get_other_mapping() {
$othermapped = array();
$othermapped['groupid'] = array('db' => 'groups', 'restore' => 'group');
return $othermapped;
}
}

View file

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