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

@ -128,4 +128,8 @@ class assessable_uploaded extends \core\event\assessable_uploaded {
public function set_legacy_logdata($legacylogdata) {
$this->legacylogdata = $legacylogdata;
}
public static function get_objectid_mapping() {
return array('db' => 'workshop_submissions', 'restore' => 'workshop_submission');
}
}

View file

@ -80,4 +80,13 @@ class assessment_evaluated extends \core\event\base {
public function get_url() {
return new \moodle_url('/mod/workshop/view.php', array('id' => $this->contextinstanceid));
}
public static function get_objectid_mapping() {
return array('db' => 'workshop_aggregations', 'restore' => 'workshop_aggregation');
}
public static function get_other_mapping() {
// Nothing to map.
return false;
}
}

View file

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

View file

@ -90,4 +90,13 @@ class assessment_reevaluated extends \core\event\base {
public function get_url() {
return new \moodle_url('/mod/workshop/view.php', array('id' => $this->contextinstanceid));
}
public static function get_objectid_mapping() {
return array('db' => 'workshop_aggregations', 'restore' => 'workshop_aggregation');
}
public static function get_other_mapping() {
// Nothing to map.
return false;
}
}

View file

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

View file

@ -71,4 +71,8 @@ class course_module_viewed extends \core\event\course_module_viewed {
$workshop = new \workshop($workshop, $cm, $course);
return (object)array('workshop' => $workshop, 'user' => $USER);
}
public static function get_objectid_mapping() {
return array('db' => 'workshop', 'restore' => 'workshop');
}
}

View file

@ -103,4 +103,13 @@ class phase_switched extends \core\event\base {
throw new \coding_exception('The \'workshopphase\' value must be set in other.');
}
}
public static function get_objectid_mapping() {
return array('db' => 'workshop', 'restore' => 'workshop');
}
public static function get_other_mapping() {
// Nothing to map.
return false;
}
}

View file

@ -108,4 +108,16 @@ class submission_assessed extends \core\event\base {
throw new \coding_exception('The \'submissionid\' value must be set in other.');
}
}
public static function get_objectid_mapping() {
return array('db' => 'workshop_assessments', 'restore' => 'workshop_assessment');
}
public static function get_other_mapping() {
$othermapped = array();
$othermapped['submissionid'] = array('db' => 'workshop_submissions', 'restore' => 'workshop_submission');
$othermapped['workshopid'] = array('db' => 'workshop', 'restore' => 'workshop');
return $othermapped;
}
}

View file

@ -88,4 +88,13 @@ class submission_created extends \core\event\base {
'submission.php?cmid=' . $this->contextinstanceid . '&id=' . $this->objectid,
$this->objectid, $this->contextinstanceid);
}
public static function get_objectid_mapping() {
return array('db' => 'workshop_submissions', 'restore' => 'workshop_submission');
}
public static function get_other_mapping() {
// Nothing to map.
return false;
}
}

View file

@ -109,4 +109,16 @@ class submission_reassessed extends \core\event\base {
throw new \coding_exception('The \'submissionid\' value must be set in other.');
}
}
public static function get_objectid_mapping() {
return array('db' => 'workshop_assessments', 'restore' => 'workshop_assessment');
}
public static function get_other_mapping() {
$othermapped = array();
$othermapped['submissionid'] = array('db' => 'workshop_submissions', 'restore' => 'workshop_submission');
$othermapped['workshopid'] = array('db' => 'workshop', 'restore' => 'workshop');
return $othermapped;
}
}

View file

@ -88,4 +88,13 @@ class submission_updated extends \core\event\base {
'submission.php?cmid=' . $this->contextinstanceid . '&id=' . $this->objectid,
$this->objectid, $this->contextinstanceid);
}
public static function get_objectid_mapping() {
return array('db' => 'workshop_submissions', 'restore' => 'workshop_submission');
}
public static function get_other_mapping() {
// Nothing to map.
return false;
}
}

View file

@ -102,4 +102,15 @@ class submission_viewed extends \core\event\base {
throw new \coding_exception('The \'relateduserid\' must be set.');
}
}
public static function get_objectid_mapping() {
return array('db' => 'workshop_submissions', 'restore' => 'workshop_submission');
}
public static function get_other_mapping() {
$othermapped = array();
$othermapped['workshopid'] = array('db' => 'workshop', 'restore' => 'workshop');
return $othermapped;
}
}