MDL-46455 events: Add mapping info to events

This commit covers all events outside of /mod/. It adds mapping info for restoring
events, or the default implementation which returns false if mapping is not required.
This commit is contained in:
Damyon Wiese
2015-10-11 18:14:58 -07:00
committed by Mark Nelson
parent 0bfafc5ba0
commit 0817451470
107 changed files with 702 additions and 0 deletions
@@ -74,4 +74,9 @@ class rule_created extends \core\event\base {
return new \moodle_url('/admin/tool/monitor/edit.php', array('ruleid' => $this->objectid,
'courseid' => $this->courseid));
}
public static function get_objectid_mapping() {
// No mapping required for this event because event monitor rules are not backed up.
return false;
}
}
@@ -73,4 +73,9 @@ class rule_deleted extends \core\event\base {
public function get_url() {
return new \moodle_url('/admin/tool/monitor/managerules.php', array('courseid' => $this->courseid));
}
public static function get_objectid_mapping() {
// No mapping required for this event because event monitor rules are not backed up.
return false;
}
}
@@ -74,4 +74,9 @@ class rule_updated extends \core\event\base {
return new \moodle_url('/admin/tool/monitor/edit.php', array('ruleid' => $this->objectid,
'courseid' => $this->courseid));
}
public static function get_objectid_mapping() {
// No mapping required for this event because event monitor rules are not backed up.
return false;
}
}
@@ -64,4 +64,9 @@ class subscription_created extends \core\event\base {
public function get_description() {
return "The user with id '$this->userid' created the event monitor subscription with id '$this->objectid'.";
}
public static function get_objectid_mapping() {
// No mapping required for this event because event monitor subscriptions are not backed up.
return false;
}
}
@@ -83,4 +83,9 @@ class subscription_criteria_met extends \core\event\base {
throw new \coding_exception('The \'subscriptionid\' value must be set in other.');
}
}
public static function get_other_mapping() {
// No mapping required for this event because event monitor subscriptions are not backed up.
return false;
}
}
@@ -64,4 +64,9 @@ class subscription_deleted extends \core\event\base {
public function get_description() {
return "The user with id '$this->userid' deleted the event monitor subscription with id '$this->objectid'.";
}
public static function get_objectid_mapping() {
// No mapping required for this event because event monitor subscriptions are not backed up.
return false;
}
}
@@ -77,4 +77,8 @@ abstract class assessable_uploaded extends base {
}
}
public static function get_other_mapping() {
// Nothing to map.
return false;
}
}
+4
View File
@@ -94,4 +94,8 @@ class badge_awarded extends base {
throw new \coding_exception('The \'objectid\' must be set.');
}
}
public static function get_objectid_mapping() {
return array('db' => 'badge', 'restore' => 'badge');
}
}
@@ -125,4 +125,14 @@ class blog_association_created extends base {
throw new \coding_exception('The \'subject\' value must be set in other.');
}
}
public static function get_objectid_mapping() {
// Blogs are not included in backups, so no mapping required.
return false;
}
public static function get_other_mapping() {
// Blogs are not included in backups, so no mapping required.
return false;
}
}
@@ -52,4 +52,14 @@ class blog_comment_created extends comment_created {
public function get_description() {
return "The user with id '$this->userid' added the comment to the blog with id '{$this->other['itemid']}'.";
}
public static function get_objectid_mapping() {
// Blogs are not included in backups, so no mapping required.
return false;
}
public static function get_other_mapping() {
// Blogs are not included in backups, so no mapping required.
return false;
}
}
@@ -52,4 +52,14 @@ class blog_comment_deleted extends comment_deleted {
public function get_description() {
return "The user with id '$this->userid' deleted the comment for the blog with id '{$this->other['itemid']}'.";
}
public static function get_objectid_mapping() {
// Blogs are not included in backups, so no mapping required.
return false;
}
public static function get_other_mapping() {
// Blogs are not included in backups, so no mapping required.
return false;
}
}
+10
View File
@@ -106,4 +106,14 @@ class blog_entries_viewed extends base {
$url = new \moodle_url('index.php', $params);
return array (SITEID, 'blog', 'view', $url->out(), 'view blog entry');
}
public static function get_other_mapping() {
$othermapped = array();
$othermapped['userid'] = array('db' => 'user', 'restore' => 'user');
$othermapped['modid'] = array('db' => 'course_modules', 'restore' => 'course_module');
$othermapped['groupid'] = array('db' => 'groups', 'restore' => 'group');
$othermapped['courseid'] = array('db' => 'course', 'restore' => 'course');
return $othermapped;
}
}
+5
View File
@@ -140,4 +140,9 @@ class blog_entry_created extends base {
throw new \coding_exception('The \'relateduserid\' must be set.');
}
}
public static function get_objectid_mapping() {
// Blogs are not backed up, so no mapping required.
return false;
}
}
+5
View File
@@ -131,4 +131,9 @@ class blog_entry_deleted extends base {
throw new \coding_exception('The \'relateduserid\' must be set.');
}
}
public static function get_objectid_mapping() {
// Blogs are not backed up, so no need for mapping.
return false;
}
}
+5
View File
@@ -138,5 +138,10 @@ class blog_entry_updated extends base {
throw new \coding_exception('The \'relateduserid\' must be set.');
}
}
public static function get_objectid_mapping() {
// Blogs are not backed up, so no need for mapping.
return false;
}
}
@@ -111,4 +111,15 @@ class calendar_event_created extends base {
throw new \coding_exception('The \'timestart\' value must be set in other.');
}
}
public static function get_objectid_mapping() {
return array('db' => 'event', 'restore' => 'event');
}
public static function get_other_mapping() {
$othermapped = array();
$othermapped['repeatid'] = array('db' => 'event', 'restore' => 'event');
return $othermapped;
}
}
@@ -92,4 +92,15 @@ class calendar_event_deleted extends base {
throw new \coding_exception('The \'timestart\' value must be set in other.');
}
}
public static function get_objectid_mapping() {
return array('db' => 'event', 'restore' => 'event');
}
public static function get_other_mapping() {
$othermapped = array();
$othermapped['repeatid'] = array('db' => 'event', 'restore' => 'event');
return $othermapped;
}
}
@@ -110,4 +110,15 @@ class calendar_event_updated extends base {
throw new \coding_exception('The \'timestart\' value must be set in other.');
}
}
public static function get_objectid_mapping() {
return array('db' => 'event', 'restore' => 'event');
}
public static function get_other_mapping() {
$othermapped = array();
$othermapped['repeatid'] = array('db' => 'event', 'restore' => 'event');
return $othermapped;
}
}
+5
View File
@@ -90,4 +90,9 @@ class cohort_created extends base {
protected function get_legacy_eventdata() {
return $this->get_record_snapshot('cohort', $this->objectid);
}
public static function get_objectid_mapping() {
// Cohorts are not included in backups, so no mapping is needed.
return false;
}
}
+5
View File
@@ -90,4 +90,9 @@ class cohort_deleted extends base {
protected function get_legacy_eventdata() {
return $this->get_record_snapshot('cohort', $this->objectid);
}
public static function get_objectid_mapping() {
// Cohorts are not included in backups, so no mapping is needed.
return false;
}
}
@@ -108,4 +108,9 @@ class cohort_member_added extends base {
throw new \coding_exception('The \'relateduserid\' must be set.');
}
}
public static function get_objectid_mapping() {
// Cohorts are not included in backups, so no mapping is needed.
return false;
}
}
@@ -109,4 +109,9 @@ class cohort_member_removed extends base {
throw new \coding_exception('The \'relateduserid\' must be set.');
}
}
public static function get_objectid_mapping() {
// Cohorts are not included in backups, so no mapping is needed.
return false;
}
}
+5
View File
@@ -90,4 +90,9 @@ class cohort_updated extends base {
protected function get_legacy_eventdata() {
return $this->get_record_snapshot('cohort', $this->objectid);
}
public static function get_objectid_mapping() {
// Cohorts are not included in backups, so no mapping is needed.
return false;
}
}
+9
View File
@@ -100,4 +100,13 @@ abstract class comment_created extends base {
throw new \coding_exception('The \'itemid\' value must be set in other.');
}
}
public static function get_objectid_mapping() {
return array('db' => 'comment', 'restore' => 'comment');
}
public static function get_other_mapping() {
// We cannot map fields that do not have a 1:1 mapping.
return false;
}
}
+9
View File
@@ -100,4 +100,13 @@ abstract class comment_deleted extends base {
throw new \coding_exception('The \'itemid\' value must be set in other.');
}
}
public static function get_objectid_mapping() {
return array('db' => 'comment', 'restore' => 'comment');
}
public static function get_other_mapping() {
// We cannot map fields that do not have a 1:1 mapping.
return false;
}
}
+4
View File
@@ -126,5 +126,9 @@ abstract class content_viewed extends base {
throw new \coding_exception('The \'content\' value must be set in other.');
}
}
public static function get_other_mapping() {
return false;
}
}
@@ -80,4 +80,9 @@ class course_category_created extends base {
protected function get_legacy_logdata() {
return array(SITEID, 'category', 'add', 'editcategory.php?id=' . $this->objectid, $this->objectid);
}
public static function get_objectid_mapping() {
// Categories are not backed up, so no need to map them.
return false;
}
}
@@ -136,4 +136,9 @@ class course_category_deleted extends base {
throw new \coding_exception('The \'name\' value must be set in other.');
}
}
public static function get_objectid_mapping() {
// Categories are not backed up, so no need to map them.
return false;
}
}
@@ -96,4 +96,9 @@ class course_category_updated extends base {
return array(SITEID, 'category', 'update', 'editcategory.php?id=' . $this->objectid, $this->objectid);
}
public static function get_objectid_mapping() {
// Categories are not backed up, so no need to map them.
return false;
}
}
+11
View File
@@ -134,4 +134,15 @@ class course_completed extends base {
throw new \coding_exception('The \'relateduserid\' value must be set in other.');
}
}
public static function get_objectid_mapping() {
// Sorry - there is no mapping available for completion records.
return false;
}
public static function get_other_mapping() {
$othermapped = array();
$othermapped['relateduserid'] = array('db' => 'user', 'restore' => 'user');
return $othermapped;
}
}
@@ -104,4 +104,8 @@ class course_content_deleted extends base {
throw new \coding_exception('The \'options\' value must be set in other.');
}
}
public static function get_objectid_mapping() {
return array('db' => 'course', 'restore' => 'course');
}
}
+4
View File
@@ -119,4 +119,8 @@ class course_created extends base {
throw new \coding_exception('The \'fullname\' value must be set in other.');
}
}
public static function get_objectid_mapping() {
return array('db' => 'course', 'restore' => 'course');
}
}
+4
View File
@@ -114,4 +114,8 @@ class course_deleted extends base {
throw new \coding_exception('The \'fullname\' value must be set in other.');
}
}
public static function get_objectid_mapping() {
return array('db' => 'course', 'restore' => 'course');
}
}
@@ -107,4 +107,9 @@ class course_module_completion_updated extends base {
throw new \coding_exception('The \'relateduserid\' must be set.');
}
}
public static function get_objectid_mapping() {
// Sorry mapping info is not available for course modules completion records.
return false;
}
}
@@ -165,5 +165,13 @@ class course_module_created extends base {
throw new \coding_exception('The \'name\' value must be set in other.');
}
}
public static function get_objectid_mapping() {
return array('db' => 'course_modules', 'restore' => 'course_module');
}
public static function get_other_mapping() {
return false;
}
}
@@ -119,5 +119,9 @@ class course_module_deleted extends base {
throw new \coding_exception('The \'instanceid\' value must be set in other.');
}
}
public static function get_objectid_mapping() {
return array('db' => 'course_modules', 'restore' => 'course_module');
}
}
@@ -163,5 +163,13 @@ class course_module_updated extends base {
));
return $event;
}
public static function get_objectid_mapping() {
return array('db' => 'course_modules', 'restore' => 'course_module');
}
public static function get_other_mapping() {
return false;
}
}
+5
View File
@@ -90,4 +90,9 @@ class course_reset_ended extends base {
throw new \coding_exception('The \'reset_options\' value must be set in other.');
}
}
public static function get_other_mapping() {
// Nothing to map.
return false;
}
}
@@ -90,4 +90,8 @@ class course_reset_started extends base {
throw new \coding_exception('The \'reset_options\' value must be set in other.');
}
}
public static function get_other_mapping() {
return false;
}
}
+4
View File
@@ -137,4 +137,8 @@ class course_restored extends base {
throw new \coding_exception('The \'samesite\' value must be set in other.');
}
}
public static function get_objectid_mapping() {
return array('db' => 'course', 'restore' => 'course');
}
}
@@ -104,4 +104,8 @@ class course_section_updated extends base {
throw new \coding_exception('The \'sectionnum\' value must be set in other.');
}
}
public static function get_objectid_mapping() {
return array('db' => 'course_sections', 'restore' => 'course_section');
}
}
+4
View File
@@ -117,4 +117,8 @@ class course_updated extends base {
protected function get_legacy_logdata() {
return $this->legacylogdata;
}
public static function get_objectid_mapping() {
return array('db' => 'course', 'restore' => 'course');
}
}
+5
View File
@@ -141,4 +141,9 @@ class course_viewed extends base {
throw new \coding_exception('Context level must be CONTEXT_COURSE.');
}
}
public static function get_other_mapping() {
// No mapping required.
return false;
}
}
+4
View File
@@ -94,4 +94,8 @@ class email_failed extends base {
throw new \coding_exception('The \'errorinfo\' value must be set in other.');
}
}
public static function get_other_mapping() {
return false;
}
}
+4
View File
@@ -131,4 +131,8 @@ class grade_deleted extends base {
throw new \coding_exception('The \'overridden\' value must be set in other.');
}
}
public static function get_objectid_mapping() {
return array('db' => 'grade_grades', 'restore' => 'grade_grades');
}
}
+4
View File
@@ -90,4 +90,8 @@ class group_created extends base {
$this->data['edulevel'] = self::LEVEL_OTHER;
$this->data['objecttable'] = 'groups';
}
public static function get_objectid_mapping() {
return array('db' => 'groups', 'restore' => 'group');
}
}
+4
View File
@@ -90,4 +90,8 @@ class group_deleted extends base {
$this->data['edulevel'] = self::LEVEL_OTHER;
$this->data['objecttable'] = 'groups';
}
public static function get_objectid_mapping() {
return array('db' => 'groups', 'restore' => 'group');
}
}
+9
View File
@@ -125,4 +125,13 @@ class group_member_added extends base {
throw new \coding_exception('The \'itemid\' value must be set in other, even if empty.');
}
}
public static function get_objectid_mapping() {
return array('db' => 'groups', 'restore' => 'group');
}
public static function get_other_mapping() {
// Nothing to map.
return false;
}
}
@@ -108,4 +108,9 @@ class group_member_removed extends base {
throw new \coding_exception('The \'relateduserid\' must be set.');
}
}
public static function get_objectid_mapping() {
return array('db' => 'groups', 'restore' => 'group');
}
}
+4
View File
@@ -90,4 +90,8 @@ class group_updated extends base {
$this->data['edulevel'] = self::LEVEL_OTHER;
$this->data['objecttable'] = 'groups';
}
public static function get_objectid_mapping() {
return array('db' => 'groups', 'restore' => 'group');
}
}
+4
View File
@@ -90,4 +90,8 @@ class grouping_created extends base {
$this->data['edulevel'] = self::LEVEL_OTHER;
$this->data['objecttable'] = 'groupings';
}
public static function get_objectid_mapping() {
return array('db' => 'groupings', 'restore' => 'grouping');
}
}
+4
View File
@@ -97,4 +97,8 @@ class grouping_deleted extends base {
$this->data['edulevel'] = self::LEVEL_OTHER;
$this->data['objecttable'] = 'groupings';
}
public static function get_objectid_mapping() {
return array('db' => 'groupings', 'restore' => 'grouping');
}
}
+4
View File
@@ -90,4 +90,8 @@ class grouping_updated extends base {
$this->data['edulevel'] = self::LEVEL_OTHER;
$this->data['objecttable'] = 'groupings';
}
public static function get_objectid_mapping() {
return array('db' => 'groupings', 'restore' => 'grouping');
}
}
@@ -94,4 +94,9 @@ class message_contact_added extends base {
throw new \coding_exception('The \'relateduserid\' must be set.');
}
}
public static function get_objectid_mapping() {
// Messaging contacts are not backed up, so no need to map them.
return false;
}
}
@@ -94,4 +94,9 @@ class message_contact_blocked extends base {
throw new \coding_exception('The \'relateduserid\' must be set.');
}
}
public static function get_objectid_mapping() {
// Messaging contacts are not backed up, so no need to map them.
return false;
}
}
@@ -94,4 +94,9 @@ class message_contact_removed extends base {
throw new \coding_exception('The \'relateduserid\' must be set.');
}
}
public static function get_objectid_mapping() {
// Messaging contacts are not backed up, so no need to map them.
return false;
}
}
@@ -94,4 +94,9 @@ class message_contact_unblocked extends base {
throw new \coding_exception('The \'relateduserid\' must be set.');
}
}
public static function get_objectid_mapping() {
// Messaging contacts are not backed up, so no need to map them.
return false;
}
}
+5
View File
@@ -142,4 +142,9 @@ class message_deleted extends base {
throw new \coding_exception('The \'useridto\' value must be set in other.');
}
}
public static function get_other_mapping() {
// Messages are not backed up, so no need to map them.
return false;
}
}
+10
View File
@@ -144,4 +144,14 @@ class message_sent extends base {
throw new \coding_exception('The \'messageid\' value must be set in other.');
}
}
public static function get_objectid_mapping() {
// Messages are not backed up, so no need to map them.
return false;
}
public static function get_other_mapping() {
// Messages are not backed up, so no need to map them.
return false;
}
}
+10
View File
@@ -95,4 +95,14 @@ class message_viewed extends base {
throw new \coding_exception('The \'messageid\' value must be set in other.');
}
}
public static function get_objectid_mapping() {
// Messages are not backed up, so no need to map them.
return false;
}
public static function get_other_mapping() {
// Messages are not backed up, so no need to map them.
return false;
}
}
@@ -113,4 +113,14 @@ class mnet_access_control_created extends base {
throw new \coding_exception('The \'accessctrl\' value must be set in other.');
}
}
public static function get_objectid_mapping() {
// Mnet info is not backed up, so no need to map.
return false;
}
public static function get_other_mapping() {
// Mnet info is not backed up, so no need to map.
return false;
}
}
@@ -113,4 +113,14 @@ class mnet_access_control_updated extends base {
throw new \coding_exception('The \'accessctrl\' value must be set in other.');
}
}
public static function get_objectid_mapping() {
// Mnet info is not backed up, so no need to map.
return false;
}
public static function get_other_mapping() {
// Mnet info is not backed up, so no need to map.
return false;
}
}
+10
View File
@@ -106,4 +106,14 @@ class note_created extends base {
throw new \coding_exception('The \'relateduserid\' must be set.');
}
}
public static function get_objectid_mapping() {
// Notes are not backed up, so no need to map.
return false;
}
public static function get_other_mapping() {
// Notes are not backed up, so no need to map.
return false;
}
}
+10
View File
@@ -96,4 +96,14 @@ class note_deleted extends base {
throw new \coding_exception('The \'relateduserid\' must be set.');
}
}
public static function get_objectid_mapping() {
// Notes are not backed up, so no need to map.
return false;
}
public static function get_other_mapping() {
// Notes are not backed up, so no need to map.
return false;
}
}
+10
View File
@@ -106,4 +106,14 @@ class note_updated extends base {
throw new \coding_exception('The \'relateduserid\' must be set.');
}
}
public static function get_objectid_mapping() {
// Notes are not backed up, so no need to map.
return false;
}
public static function get_other_mapping() {
// Notes are not backed up, so no need to map.
return false;
}
}
+10
View File
@@ -86,4 +86,14 @@ class notes_viewed extends base {
return array($this->courseid, 'notes', 'view', 'index.php?course=' . $this->courseid.'&user=' . $this->relateduserid,
'view notes');
}
public static function get_objectid_mapping() {
// Notes are not backed up, so no need to map.
return false;
}
public static function get_other_mapping() {
// Notes are not backed up, so no need to map.
return false;
}
}
@@ -96,4 +96,8 @@ class question_category_created extends base {
// This is not related to individual quiz at all.
return null;
}
public static function get_objectid_mapping() {
return array('db' => 'question_categories', 'restore' => 'question_category');
}
}
+9
View File
@@ -131,4 +131,13 @@ class role_assigned extends base {
throw new \coding_exception('The \'component\' value must be set in other.');
}
}
public static function get_objectid_mapping() {
return array('db' => 'role', 'restore' => 'role');
}
public static function get_other_mapping() {
// Nothing mappable.
return false;
}
}
@@ -98,4 +98,8 @@ class role_capabilities_updated extends base {
protected function get_legacy_logdata() {
return $this->legacylogdata;
}
public static function get_objectid_mapping() {
return array('db' => 'role', 'restore' => 'role');
}
}
+4
View File
@@ -102,4 +102,8 @@ class role_deleted extends base {
throw new \coding_exception('The \'shortname\' value must be set in other.');
}
}
public static function get_objectid_mapping() {
return array('db' => 'role', 'restore' => 'role');
}
}
+8
View File
@@ -128,4 +128,12 @@ class role_unassigned extends base {
throw new \coding_exception('The \'component\' value must be set in other.');
}
}
public static function get_objectid_mapping() {
return array('db' => 'role', 'restore' => 'role');
}
public static function get_other_mapping() {
return false;
}
}
+10
View File
@@ -117,4 +117,14 @@ class tag_added extends base {
throw new \coding_exception('The \'tagrawname\' value must be set in other.');
}
}
public static function get_objectid_mapping() {
// Tags cannot be mapped by id.
return false;
}
public static function get_other_mapping() {
return false;
}
}
+9
View File
@@ -87,4 +87,13 @@ class tag_created extends base {
throw new \coding_exception('The \'rawname\' value must be set in other.');
}
}
public static function get_objectid_mapping() {
// Tags cannot be mapped by id.
return false;
}
public static function get_other_mapping() {
return false;
}
}
+9
View File
@@ -87,4 +87,13 @@ class tag_deleted extends base {
throw new \coding_exception('The \'rawname\' value must be set in other.');
}
}
public static function get_objectid_mapping() {
// Tags cannot be mapped by id.
return false;
}
public static function get_other_mapping() {
return false;
}
}
+9
View File
@@ -96,4 +96,13 @@ class tag_flagged extends base {
throw new \coding_exception('The \'rawname\' value must be set in other.');
}
}
public static function get_objectid_mapping() {
// Tags cannot be mapped by id.
return false;
}
public static function get_other_mapping() {
return false;
}
}
+10
View File
@@ -103,4 +103,14 @@ class tag_removed extends base {
throw new \coding_exception('The \'tagrawname\' value must be set in other.');
}
}
public static function get_objectid_mapping() {
// Tags cannot be mapped.
return false;
}
public static function get_other_mapping() {
return false;
}
}
+10
View File
@@ -87,4 +87,14 @@ class tag_unflagged extends base {
throw new \coding_exception('The \'rawname\' value must be set in other.');
}
}
public static function get_objectid_mapping() {
// Tags cannot be mapped.
return false;
}
public static function get_other_mapping() {
return false;
}
}
+10
View File
@@ -112,4 +112,14 @@ class tag_updated extends base {
throw new \coding_exception('The \'rawname\' value must be set in other.');
}
}
public static function get_objectid_mapping() {
// Tags cannot be mapped.
return false;
}
public static function get_other_mapping() {
return false;
}
}
+4
View File
@@ -133,4 +133,8 @@ class user_created extends base {
$event = self::create($data);
return $event;
}
public static function get_objectid_mapping() {
return array('db' => 'user', 'restore' => 'user');
}
}
+8
View File
@@ -141,4 +141,12 @@ class user_deleted extends base {
throw new \coding_exception('The \'mnethostid\' value must be set in other.');
}
}
public static function get_objectid_mapping() {
return array('db' => 'user', 'restore' => 'user');
}
public static function get_other_mapping() {
return false;
}
}
@@ -125,4 +125,13 @@ class user_enrolment_created extends base {
throw new \coding_exception('The \'enrol\' value must be set in other.');
}
}
public static function get_objectid_mapping() {
// User enrolments table is not mappable.
return false;
}
public static function get_other_mapping() {
return false;
}
}
@@ -124,4 +124,13 @@ class user_enrolment_deleted extends base {
throw new \coding_exception('The \'relateduserid\' must be set.');
}
}
public static function get_objectid_mapping() {
// User enrolments table is not mappable.
return false;
}
public static function get_other_mapping() {
return false;
}
}
@@ -114,4 +114,13 @@ class user_enrolment_updated extends base {
throw new \coding_exception('The \'relateduserid\' must be set.');
}
}
public static function get_objectid_mapping() {
// User enrolments table is not mappable.
return false;
}
public static function get_other_mapping() {
return false;
}
}
+11
View File
@@ -156,4 +156,15 @@ class user_graded extends base {
throw new \coding_exception('The \'itemid\' value must be set in other.');
}
}
public static function get_objectid_mapping() {
return array('db' => 'grade_grades', 'restore' => 'grade_grades');
}
public static function get_other_mapping() {
$othermapped = array();
$othermapped['itemid'] = array('db' => 'grade_items', 'restore' => 'grade_item');
return $othermapped;
}
}
+8
View File
@@ -88,4 +88,12 @@ class user_list_viewed extends base {
protected function get_legacy_logdata() {
return array($this->courseid, 'user', 'view all', 'index.php?id=' . $this->courseid, '');
}
public static function get_objectid_mapping() {
return array('db' => 'course', 'restore' => 'course');
}
public static function get_other_mapping() {
return false;
}
}
+8
View File
@@ -113,4 +113,12 @@ class user_loggedin extends base {
throw new \coding_exception('The \'username\' value must be set in other.');
}
}
public static function get_objectid_mapping() {
return array('db' => 'user', 'restore' => 'user');
}
public static function get_other_mapping() {
return false;
}
}
+8
View File
@@ -112,4 +112,12 @@ class user_loggedinas extends base {
throw new \coding_exception('The \'loggedinasusername\' value must be set in other.');
}
}
public static function get_objectid_mapping() {
return array('db' => 'user', 'restore' => 'user');
}
public static function get_other_mapping() {
return false;
}
}
+8
View File
@@ -105,4 +105,12 @@ class user_loggedout extends base {
return array(SITEID, 'user', 'logout', 'view.php?id='.$this->objectid.'&course='.SITEID, $this->objectid, 0,
$this->objectid);
}
public static function get_objectid_mapping() {
return array('db' => 'user', 'restore' => 'user');
}
public static function get_other_mapping() {
return false;
}
}
+3
View File
@@ -113,4 +113,7 @@ class user_login_failed extends base {
}
}
public static function get_other_mapping() {
return false;
}
}
@@ -130,4 +130,8 @@ class user_password_updated extends base {
throw new \coding_exception('The \'forgottenreset\' value must be set in other.');
}
}
public static function get_other_mapping() {
return false;
}
}
+11
View File
@@ -111,4 +111,15 @@ class user_profile_viewed extends base {
throw new \coding_exception('The \'relateduserid\' must be set.');
}
}
public static function get_objectid_mapping() {
return array('db' => 'user', 'restore' => 'user');
}
public static function get_other_mapping() {
$othermapped = array();
$othermapped['courseid'] = array('db' => 'course', 'restore' => 'course');
return $othermapped;
}
}
+4
View File
@@ -133,4 +133,8 @@ class user_updated extends base {
$event = self::create($data);
return $event;
}
public static function get_objectid_mapping() {
return array('db' => 'user', 'restore' => 'user');
}
}
@@ -105,4 +105,8 @@ class webservice_function_called extends base {
throw new \coding_exception('The \'function\' value must be set in other.');
}
}
public static function get_other_mapping() {
return false;
}
}
@@ -123,4 +123,8 @@ class webservice_login_failed extends base {
throw new \coding_exception('The \'token\' value must not be set in other.');
}
}
public static function get_other_mapping() {
return false;
}
}
@@ -91,4 +91,13 @@ class webservice_service_created extends base {
$this->data['edulevel'] = self::LEVEL_OTHER;
$this->data['objecttable'] = 'external_services';
}
public static function get_objectid_mapping() {
// Webservices are not included in the backups.
return false;
}
public static function get_other_mapping() {
return false;
}
}
@@ -85,4 +85,10 @@ class webservice_service_deleted extends base {
$this->data['edulevel'] = self::LEVEL_OTHER;
$this->data['objecttable'] = 'external_services';
}
public static function get_objectid_mapping() {
// Webservices are not included in backups.
return false;
}
}
@@ -85,4 +85,10 @@ class webservice_service_updated extends base {
$this->data['edulevel'] = self::LEVEL_OTHER;
$this->data['objecttable'] = 'external_services';
}
public static function get_objectid_mapping() {
// Webservices are not included in backups.
return false;
}
}
@@ -98,4 +98,10 @@ class webservice_service_user_added extends base {
throw new \coding_exception('The \'relateduserid\' must be set.');
}
}
public static function get_objectid_mapping() {
// Webservices are not included in backups.
return false;
}
}
@@ -98,4 +98,10 @@ class webservice_service_user_removed extends base {
throw new \coding_exception('The \'relateduserid\' must be set.');
}
}
public static function get_objectid_mapping() {
// Webservices are not included in backups.
return false;
}
}
@@ -108,4 +108,13 @@ class webservice_token_created extends base {
throw new \coding_exception('The \'auto\' value must be set in other.');
}
}
public static function get_objectid_mapping() {
// Webservices are not included in backups.
return false;
}
public static function get_other_mapping() {
return false;
}
}

Some files were not shown because too many files have changed in this diff Show More