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

@ -115,4 +115,8 @@ class all_submissions_downloaded extends base {
parent::validate_data();
}
public static function get_objectid_mapping() {
return array('db' => 'assign', 'restore' => 'assign');
}
}

View file

@ -150,4 +150,13 @@ class assessable_submitted extends base {
throw new \coding_exception('The \'submission_editable\' value must be set in other.');
}
}
public static function get_objectid_mapping() {
return array('db' => 'assign_submission', 'restore' => 'submission');
}
public static function get_other_mapping() {
// Nothing to map.
return false;
}
}

View file

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

View file

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

View file

@ -121,4 +121,8 @@ class extension_granted extends base {
throw new \coding_exception('The \'relateduserid\' must be set.');
}
}
public static function get_objectid_mapping() {
return array('db' => 'assign', 'restore' => 'assign');
}
}

View file

@ -119,4 +119,15 @@ class feedback_viewed extends base {
throw new \coding_exception('The \'assignid\' value must be set in other.');
}
}
public static function get_objectid_mapping() {
return array('db' => 'assign_grades', 'restore' => 'grade');
}
public static function get_other_mapping() {
$othermapped = array();
$othermapped['assignid'] = array('db' => 'assign', 'restore' => 'assign');
return $othermapped;
}
}

View file

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

View file

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

View file

@ -115,4 +115,8 @@ class identities_revealed extends base {
parent::validate_data();
}
public static function get_objectid_mapping() {
return array('db' => 'assign', 'restore' => 'assign');
}
}

View file

@ -140,4 +140,15 @@ class marker_updated extends base {
throw new \coding_exception('The \'markerid\' value must be set in other.');
}
}
public static function get_objectid_mapping() {
return array('db' => 'assign', 'restore' => 'assign');
}
public static function get_other_mapping() {
$othermapped = array();
$othermapped['markerid'] = array('db' => 'user', 'restore' => 'user');
return $othermapped;
}
}

View file

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

View file

@ -119,4 +119,8 @@ class statement_accepted extends base {
parent::validate_data();
}
public static function get_objectid_mapping() {
return array('db' => 'assign_submission', 'restore' => 'submission');
}
}

View file

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

View file

@ -81,4 +81,12 @@ abstract class submission_created extends base {
throw new \coding_exception('The \'submissionstatus\' value must be set in other.');
}
}
public static function get_other_mapping() {
$othermapped = array();
$othermapped['submissionid'] = array('db' => 'assign_submission', 'restore' => 'submission');
$othermapped['groupid'] = array('db' => 'groups', 'restore' => 'group');
return $othermapped;
}
}

View file

@ -117,4 +117,8 @@ class submission_duplicated extends base {
parent::validate_data();
}
public static function get_objectid_mapping() {
return array('db' => 'assign_submission', 'restore' => 'submission');
}
}

View file

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

View file

@ -123,4 +123,8 @@ class submission_graded extends base {
throw new \coding_exception('The \'relateduserid\' must be set.');
}
}
public static function get_objectid_mapping() {
return array('db' => 'assign_grades', 'restore' => 'grade');
}
}

View file

@ -123,4 +123,8 @@ class submission_locked extends base {
throw new \coding_exception('The \'relateduserid\' must be set.');
}
}
public static function get_objectid_mapping() {
return array('db' => 'assign', 'restore' => 'assign');
}
}

View file

@ -121,4 +121,13 @@ class submission_status_updated extends base {
throw new \coding_exception('The \'newstatus\' value must be set in other.');
}
}
public static function get_objectid_mapping() {
return array('db' => 'assign_submission', 'restore' => 'submission');
}
public static function get_other_mapping() {
// Nothing to map.
return false;
}
}

View file

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

View file

@ -123,4 +123,8 @@ class submission_unlocked extends base {
throw new \coding_exception('The \'relateduserid\' must be set.');
}
}
public static function get_objectid_mapping() {
return array('db' => 'assign', 'restore' => 'assign');
}
}

View file

@ -81,4 +81,12 @@ abstract class submission_updated extends base {
throw new \coding_exception('The \'submissionstatus\' value must be set in other.');
}
}
public static function get_other_mapping() {
$othermapped = array();
$othermapped['submissionid'] = array('db' => 'assign_submission', 'restore' => 'submission');
$othermapped['groupid'] = array('db' => 'groups', 'restore' => 'group');
return $othermapped;
}
}

View file

@ -119,4 +119,15 @@ class submission_viewed extends base {
throw new \coding_exception('The \'assignid\' value must be set in other.');
}
}
public static function get_objectid_mapping() {
return array('db' => 'assign_submission', 'restore' => 'submission');
}
public static function get_other_mapping() {
$othermapped = array();
$othermapped['assignid'] = array('db' => 'assign', 'restore' => 'assign');
return $othermapped;
}
}

View file

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

View file

@ -120,4 +120,7 @@ class assessable_uploaded extends \core\event\assessable_uploaded {
$this->data['objecttable'] = 'assign_submission';
}
public static function get_objectid_mapping() {
return array('db' => 'assign_submission', 'restore' => 'submission');
}
}

View file

@ -80,4 +80,9 @@ class submission_created extends \mod_assign\event\submission_created {
throw new \coding_exception('The \'filesubmissioncount\' value must be set in other.');
}
}
public static function get_objectid_mapping() {
// No mapping available for 'assignsubmission_file'.
return false;
}
}

View file

@ -80,4 +80,9 @@ class submission_updated extends \mod_assign\event\submission_updated {
throw new \coding_exception('The \'filesubmissioncount\' value must be set in other.');
}
}
public static function get_objectid_mapping() {
// No mapping available for 'assignsubmission_file'.
return false;
}
}

View file

@ -107,4 +107,8 @@ class assessable_uploaded extends \core\event\assessable_uploaded {
parent::init();
$this->data['objecttable'] = 'assign_submission';
}
public static function get_objectid_mapping() {
return array('db' => 'assign_submission', 'restore' => 'submission');
}
}

View file

@ -47,7 +47,7 @@ class submission_created extends \mod_assign\event\submission_created {
*/
protected function init() {
parent::init();
$this->data['objecttable'] = 'assignsubmission_file';
$this->data['objecttable'] = 'assignsubmission_onlinetext';
}
/**
@ -80,4 +80,9 @@ class submission_created extends \mod_assign\event\submission_created {
throw new \coding_exception('The \'onlinetextwordcount\' value must be set in other.');
}
}
public static function get_objectid_mapping() {
// No mapping available for 'assignsubmission_onlinetext'.
return false;
}
}

View file

@ -47,7 +47,7 @@ class submission_updated extends \mod_assign\event\submission_updated {
*/
protected function init() {
parent::init();
$this->data['objecttable'] = 'assignsubmission_file';
$this->data['objecttable'] = 'assignsubmission_onlinetext';
}
/**
@ -80,4 +80,9 @@ class submission_updated extends \mod_assign\event\submission_updated {
throw new \coding_exception('The \'onlinetextwordcount\' value must be set in other.');
}
}
public static function get_objectid_mapping() {
// No mapping available for 'assignsubmission_onlinetext'.
return false;
}
}