mirror of
https://github.com/moodle/moodle.git
synced 2025-08-06 17:36:38 +02:00
MDL-46455 mod_*: added restore mapping to events
This commit is contained in:
parent
ef15eae433
commit
0bfafc5ba0
170 changed files with 1364 additions and 19 deletions
|
@ -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');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue