Merge branch 'MDL-46455-master-20151012' of git://github.com/damyon/moodle
This commit is contained in:
@@ -77,4 +77,8 @@ abstract class assessable_uploaded extends base {
|
||||
}
|
||||
}
|
||||
|
||||
public static function get_other_mapping() {
|
||||
// Nothing to map.
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -94,4 +94,15 @@ 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');
|
||||
}
|
||||
|
||||
public static function get_other_mapping() {
|
||||
$othermapped = array();
|
||||
$othermapped['badgeissuedid'] = array('db' => 'badge_issued', 'restore' => base::NOT_MAPPED);
|
||||
|
||||
return $othermapped;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,6 +75,11 @@ abstract class base implements \IteratorAggregate {
|
||||
*/
|
||||
const LEVEL_PARTICIPATING = 2;
|
||||
|
||||
/**
|
||||
* The value used when an id can not be mapped during a restore.
|
||||
*/
|
||||
const NOT_MAPPED = -31337;
|
||||
|
||||
/** @var array event data */
|
||||
protected $data;
|
||||
|
||||
@@ -478,6 +483,79 @@ abstract class base implements \IteratorAggregate {
|
||||
return $event;
|
||||
}
|
||||
|
||||
/**
|
||||
* This is used when restoring course logs where it is required that we
|
||||
* map the objectid to it's new value in the new course.
|
||||
*
|
||||
* Does nothing in the base class except display a debugging message warning
|
||||
* the user that the event does not contain the required functionality to
|
||||
* map this information. For events that do not store an objectid this won't
|
||||
* be called, so no debugging message will be displayed.
|
||||
*
|
||||
* Example of usage:
|
||||
*
|
||||
* return array('db' => 'assign_submissions', 'restore' => 'submission');
|
||||
*
|
||||
* If the objectid can not be mapped during restore set the value to \core\event\base::NOT_MAPPED, example -
|
||||
*
|
||||
* return array('db' => 'some_table', 'restore' => \core\event\base::NOT_MAPPED);
|
||||
*
|
||||
* Note - it isn't necessary to specify the 'db' and 'restore' values in this case, so you can also use -
|
||||
*
|
||||
* return \core\event\base::NOT_MAPPED;
|
||||
*
|
||||
* The 'db' key refers to the database table and the 'restore' key refers to
|
||||
* the name of the restore element the objectid is associated with. In many
|
||||
* cases these will be the same.
|
||||
*
|
||||
* @return string the name of the restore mapping the objectid links to
|
||||
*/
|
||||
public static function get_objectid_mapping() {
|
||||
debugging('In order to restore course logs accurately the event "' . get_called_class() . '" must define the
|
||||
function get_objectid_mapping().', DEBUG_DEVELOPER);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* This is used when restoring course logs where it is required that we
|
||||
* map the information in 'other' to it's new value in the new course.
|
||||
*
|
||||
* Does nothing in the base class except display a debugging message warning
|
||||
* the user that the event does not contain the required functionality to
|
||||
* map this information. For events that do not store any other information this
|
||||
* won't be called, so no debugging message will be displayed.
|
||||
*
|
||||
* Example of usage:
|
||||
*
|
||||
* $othermapped = array();
|
||||
* $othermapped['discussionid'] = array('db' => 'forum_discussions', 'restore' => 'forum_discussion');
|
||||
* $othermapped['forumid'] = array('db' => 'forum', 'restore' => 'forum');
|
||||
* return $othermapped;
|
||||
*
|
||||
* If an id can not be mapped during restore we set it to \core\event\base::NOT_MAPPED, example -
|
||||
*
|
||||
* $othermapped = array();
|
||||
* $othermapped['someid'] = array('db' => 'some_table', 'restore' => \core\event\base::NOT_MAPPED);
|
||||
* return $othermapped;
|
||||
*
|
||||
* Note - it isn't necessary to specify the 'db' and 'restore' values in this case, so you can also use -
|
||||
*
|
||||
* $othermapped = array();
|
||||
* $othermapped['someid'] = \core\event\base::NOT_MAPPED;
|
||||
* return $othermapped;
|
||||
*
|
||||
* The 'db' key refers to the database table and the 'restore' key refers to
|
||||
* the name of the restore element the other value is associated with. In many
|
||||
* cases these will be the same.
|
||||
*
|
||||
* @return array an array of other values and their corresponding mapping
|
||||
*/
|
||||
public static function get_other_mapping() {
|
||||
debugging('In order to restore course logs accurately the event "' . get_called_class() . '" must define the
|
||||
function get_other_mapping().', DEBUG_DEVELOPER);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get static information about an event.
|
||||
* This is used in reports and is not for general use.
|
||||
|
||||
@@ -125,4 +125,18 @@ 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 for restore.
|
||||
return array('db' => 'blog_association', 'restore' => base::NOT_MAPPED);
|
||||
}
|
||||
|
||||
public static function get_other_mapping() {
|
||||
// Blogs are not included in backups, so no mapping required for restore.
|
||||
$othermapped = array();
|
||||
$othermapped['blogid'] = array('db' => 'post', 'restore' => base::NOT_MAPPED);
|
||||
// The associateid field is varying (context->instanceid) so cannot be mapped.
|
||||
|
||||
return $othermapped;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,4 +52,10 @@ 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_other_mapping() {
|
||||
$othermapped = array();
|
||||
$othermapped['itemid'] = array('db' => 'post', 'restore' => base::NOT_MAPPED);
|
||||
return $othermapped;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,4 +52,10 @@ 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_other_mapping() {
|
||||
$othermapped = array();
|
||||
$othermapped['itemid'] = array('db' => 'post', 'restore' => base::NOT_MAPPED);
|
||||
return $othermapped;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -106,4 +106,16 @@ 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['entryid'] = array('db' => 'post', 'restore' => base::NOT_MAPPED);
|
||||
$othermapped['tagid'] = array('db' => 'tag', 'restore' => base::NOT_MAPPED);
|
||||
$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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 for restore.
|
||||
return array('db' => 'post', 'restore' => base::NOT_MAPPED);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 for restore.
|
||||
return array('db' => 'post', 'restore' => base::NOT_MAPPED);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 for restore.
|
||||
return array('db' => 'post', 'restore' => NOT_MAPPED);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 for restore.
|
||||
return array('db' => 'cohort', 'restore' => base::NOT_MAPPED);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 for restore.
|
||||
return array('db' => 'cohort', 'restore' => base::NOT_MAPPED);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 for restore.
|
||||
return array('db' => 'cohort', 'restore' => base::NOT_MAPPED);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 for restore.
|
||||
return array('db' => 'cohort', 'restore' => base::NOT_MAPPED);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 for restore.
|
||||
return array('db' => 'cohort', 'restore' => base::NOT_MAPPED);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -100,4 +100,15 @@ 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' => 'comments', 'restore' => 'comment');
|
||||
}
|
||||
|
||||
public static function get_other_mapping() {
|
||||
// We cannot map fields that do not have a 1:1 mapping.
|
||||
$othermapped = array();
|
||||
$othermapped['itemid'] = base::NOT_MAPPED;
|
||||
return $othermapped;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -100,4 +100,15 @@ 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' => 'comments', 'restore' => 'comment');
|
||||
}
|
||||
|
||||
public static function get_other_mapping() {
|
||||
// We cannot map fields that do not have a 1:1 mapping.
|
||||
$othermapped = array();
|
||||
$othermapped['itemid'] = base::NOT_MAPPED;
|
||||
return $othermapped;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 on restore.
|
||||
return array('db' => 'course_categories', 'restore' => base::NOT_MAPPED);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -136,4 +136,13 @@ 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 on restore.
|
||||
return array('db' => 'course_categories', 'restore' => base::NOT_MAPPED);
|
||||
}
|
||||
|
||||
public static function get_other_mapping() {
|
||||
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 on restore.
|
||||
return array('db' => 'course_categories', 'restore' => base::NOT_MAPPED);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 array('db' => 'course_completions', 'restore' => base::NOT_MAPPED);
|
||||
}
|
||||
|
||||
public static function get_other_mapping() {
|
||||
$othermapped = array();
|
||||
$othermapped['relateduserid'] = array('db' => 'user', 'restore' => 'user');
|
||||
return $othermapped;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -104,4 +104,12 @@ 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');
|
||||
}
|
||||
|
||||
public static function get_other_mapping() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -119,4 +119,13 @@ 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');
|
||||
}
|
||||
|
||||
public static function get_other_mapping() {
|
||||
// Nothing to map.
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -114,4 +114,13 @@ 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');
|
||||
}
|
||||
|
||||
public static function get_other_mapping() {
|
||||
// Nothing to map.
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,6 +29,12 @@ defined('MOODLE_INTERNAL') || die();
|
||||
/**
|
||||
* Course module completion event class.
|
||||
*
|
||||
* @property-read array $other {
|
||||
* Extra information about event.
|
||||
*
|
||||
* - int relateduserid: (optional) the related user id.
|
||||
* }
|
||||
*
|
||||
* @package core
|
||||
* @since Moodle 2.6
|
||||
* @copyright 2013 Rajesh Taneja <[email protected]>
|
||||
@@ -107,4 +113,16 @@ 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 array('db' => 'course_modules_completion', 'restore' => base::NOT_MAPPED);
|
||||
}
|
||||
|
||||
public static function get_other_mapping() {
|
||||
$othermapped = array();
|
||||
$othermapped['relateduserid'] = array('db' => 'user', 'restore' => 'user');
|
||||
|
||||
return $othermapped;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -165,5 +165,16 @@ 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() {
|
||||
$othermapped = array();
|
||||
$othermapped['instanceid'] = base::NOT_MAPPED;
|
||||
|
||||
return $othermapped;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -119,5 +119,16 @@ 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');
|
||||
}
|
||||
|
||||
public static function get_other_mapping() {
|
||||
$othermapped = array();
|
||||
$othermapped['instanceid'] = base::NOT_MAPPED;
|
||||
|
||||
return $othermapped;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -163,5 +163,16 @@ 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() {
|
||||
$othermapping = array();
|
||||
$othermapping['instanceid'] = base::NOT_MAPPED;
|
||||
|
||||
return $othermapping;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -137,4 +137,13 @@ 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');
|
||||
}
|
||||
|
||||
public static function get_other_mapping() {
|
||||
// No need to map anything.
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -104,4 +104,13 @@ 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');
|
||||
}
|
||||
|
||||
public static function get_other_mapping() {
|
||||
// Nothing to map.
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -117,4 +117,13 @@ 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');
|
||||
}
|
||||
|
||||
public static function get_other_mapping() {
|
||||
// Nothing to map.
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -114,4 +114,9 @@ class course_user_report_viewed extends base {
|
||||
throw new \coding_exception('The \'mode\' value must be set in other.');
|
||||
}
|
||||
}
|
||||
|
||||
public static function get_other_mapping() {
|
||||
// Nothing to map.
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,6 +30,14 @@ defined('MOODLE_INTERNAL') || die();
|
||||
/**
|
||||
* Email failed event class.
|
||||
*
|
||||
* @property-read array $other {
|
||||
* Extra information about event.
|
||||
*
|
||||
* - string subject: the message subject.
|
||||
* - string message: the message text.
|
||||
* - string errorinfo: the error info.
|
||||
* }
|
||||
*
|
||||
* @package core
|
||||
* @since Moodle 2.7
|
||||
* @copyright 2013 Mark Nelson <[email protected]>
|
||||
@@ -94,4 +102,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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -106,4 +106,13 @@ class enrol_instance_created extends base {
|
||||
throw new \coding_exception('The \'enrol\' value must be set in other.');
|
||||
}
|
||||
}
|
||||
|
||||
public static function get_objectid_mapping() {
|
||||
return array('db' => 'enrol', 'restore' => 'enrol');
|
||||
}
|
||||
|
||||
public static function get_other_mapping() {
|
||||
// Nothing to map.
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -107,4 +107,13 @@ class enrol_instance_deleted extends base {
|
||||
throw new \coding_exception('The \'enrol\' value must be set in other.');
|
||||
}
|
||||
}
|
||||
|
||||
public static function get_objectid_mapping() {
|
||||
return array('db' => 'enrol', 'restore' => 'enrol');
|
||||
}
|
||||
|
||||
public static function get_other_mapping() {
|
||||
// Nothing to map.
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -107,4 +107,13 @@ class enrol_instance_updated extends base {
|
||||
throw new \coding_exception('The \'enrol\' value must be set in other.');
|
||||
}
|
||||
}
|
||||
|
||||
public static function get_objectid_mapping() {
|
||||
return array('db' => 'enrol', 'restore' => 'enrol');
|
||||
}
|
||||
|
||||
public static function get_other_mapping() {
|
||||
// Nothing to map.
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -131,4 +131,15 @@ 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');
|
||||
}
|
||||
|
||||
public static function get_other_mapping() {
|
||||
$othermapped = array();
|
||||
$othermapped['itemid'] = array('db' => 'grade_items', 'restore' => 'grade_item');
|
||||
|
||||
return $othermapped;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -125,4 +125,15 @@ 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() {
|
||||
$othermapped = array();
|
||||
$othermapped['itemid'] = base::NOT_MAPPED;
|
||||
|
||||
return $othermapped;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 on restore.
|
||||
return array('db' => 'message_contacts', 'restore' => base::NOT_MAPPED);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 on restore.
|
||||
return array('db' => 'message_contacts', 'restore' => base::NOT_MAPPED);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 on restore.
|
||||
return array('db' => 'message_contacts', 'restore' => base::NOT_MAPPED);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 on restore.
|
||||
return array('db' => 'message_contacts', 'restore' => base::NOT_MAPPED);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -142,4 +142,14 @@ 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 on restore.
|
||||
$othermapped = array();
|
||||
// The messageid table varies so it cannot be mapped.
|
||||
$othermapped['messageid'] = array('db' => base::NOT_MAPPED, 'restore' => base::NOT_MAPPED);
|
||||
$othermapped['useridfrom'] = array('db' => 'user', 'restore' => base::NOT_MAPPED);
|
||||
$othermapped['useridto'] = array('db' => 'user', 'restore' => base::NOT_MAPPED);
|
||||
return $othermapped;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -144,4 +144,17 @@ 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 on restore.
|
||||
$othermapped = array();
|
||||
// The messages table could vary for older events - so cannot be mapped.
|
||||
$othermapped['messageid'] = array('db' => base::NOT_MAPPED, 'restore' => base::NOT_MAPPED);
|
||||
return $othermapped;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -95,4 +95,17 @@ 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 array('db' => 'message_read', 'restore' => base::NOT_MAPPED);
|
||||
}
|
||||
|
||||
public static function get_other_mapping() {
|
||||
// Messages are not backed up, so no need to map them on restore.
|
||||
$othermapped = array();
|
||||
// The messages table could vary for older events - so cannot be mapped.
|
||||
$othermapped['messageid'] = array('db' => base::NOT_MAPPED, 'restore' => base::NOT_MAPPED);
|
||||
return $othermapped;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 on restore.
|
||||
return array('db' => 'mnet_sso_access_control', 'restore' => base::NOT_MAPPED);
|
||||
}
|
||||
|
||||
public static function get_other_mapping() {
|
||||
// Nothing 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 on restore.
|
||||
return array('db' => 'mnet_sso_access_control', 'restore' => base::NOT_MAPPED);
|
||||
}
|
||||
|
||||
public static function get_other_mapping() {
|
||||
// Nothing to map.
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 on restore.
|
||||
return array('db' => 'post', 'restore' => base::NOT_MAPPED);
|
||||
}
|
||||
|
||||
public static function get_other_mapping() {
|
||||
// Nothing to map.
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 on restore.
|
||||
return array('db' => 'post', 'restore' => base::NOT_MAPPED);
|
||||
}
|
||||
|
||||
public static function get_other_mapping() {
|
||||
// Nothing to map.
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 on restore.
|
||||
return array('db' => 'post', 'restore' => base::NOT_MAPPED);
|
||||
}
|
||||
|
||||
public static function get_other_mapping() {
|
||||
// Nothing 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');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -131,4 +131,16 @@ 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() {
|
||||
$othermapped = array();
|
||||
$othermapped['id'] = array('db' => 'role_assignments', 'restore' => base::NOT_MAPPED);
|
||||
$othermapped['itemid'] = base::NOT_MAPPED;
|
||||
|
||||
return $othermapped;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -102,4 +102,13 @@ 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');
|
||||
}
|
||||
|
||||
public static function get_other_mapping() {
|
||||
// Nothing to map.
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -128,4 +128,16 @@ 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() {
|
||||
$othermapped = array();
|
||||
$othermapped['id'] = array('db' => 'role_assignments', 'restore' => base::NOT_MAPPED);
|
||||
$othermapped['itemid'] = base::NOT_MAPPED;
|
||||
|
||||
return $othermapped;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -117,4 +117,17 @@ 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.
|
||||
return array('db' => 'tag_instance', 'restore' => base::NOT_MAPPED);
|
||||
}
|
||||
|
||||
public static function get_other_mapping() {
|
||||
$othermapped = array();
|
||||
$othermapped['tagid'] = array('db' => 'tag', 'restore' => base::NOT_MAPPED);
|
||||
$othermapped['itemid'] = base::NOT_MAPPED;
|
||||
|
||||
return $othermapped;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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.
|
||||
return array('db' => 'tag', 'restore' => base::NOT_MAPPED);
|
||||
}
|
||||
|
||||
public static function get_other_mapping() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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.
|
||||
return array('db' => 'tag', 'restore' => base::NOT_MAPPED);
|
||||
}
|
||||
|
||||
public static function get_other_mapping() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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.
|
||||
return array('db' => 'tag', 'restore' => base::NOT_MAPPED);
|
||||
}
|
||||
|
||||
public static function get_other_mapping() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -103,4 +103,18 @@ 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 array('db' => 'tag_instance', 'restore' => base::NOT_MAPPED);
|
||||
}
|
||||
|
||||
public static function get_other_mapping() {
|
||||
$othermapped = array();
|
||||
$othermapped['tagid'] = array('db' => 'tag', 'restore' => base::NOT_MAPPED);
|
||||
$othermapped['itemid'] = base::NOT_MAPPED;
|
||||
|
||||
return $othermapped;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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 array('db' => 'tag', 'restore' => base::NOT_MAPPED);
|
||||
}
|
||||
|
||||
public static function get_other_mapping() {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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 array('db' => 'tag', 'restore' => base::NOT_MAPPED);
|
||||
}
|
||||
|
||||
public static function get_other_mapping() {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -141,4 +141,15 @@ 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() {
|
||||
$othermapped = array();
|
||||
$othermapped['mnethostid'] = array('db' => 'mnet_host', 'restore' => base::NOT_MAPPED);
|
||||
|
||||
return $othermapped;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 array('db' => 'user_enrolments', 'restore' => base::NOT_MAPPED);
|
||||
}
|
||||
|
||||
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 array('db' => 'user_enrolments', 'restore' => base::NOT_MAPPED);
|
||||
}
|
||||
|
||||
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 array('db' => 'user_enrolments', 'restore' => base::NOT_MAPPED);
|
||||
}
|
||||
|
||||
public static function get_other_mapping() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 array('db' => 'external_services', 'restore' => NOT_MAPPED);
|
||||
}
|
||||
|
||||
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 array('db' => 'external_services', 'restore' => base::NOT_MAPPED);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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 array('db' => 'external_services', 'restore' => base::NOT_MAPPED);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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 array('db' => 'external_services', 'restore' => base::NOT_MAPPED);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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 array('db' => 'external_services', 'restore' => base::NOT_MAPPED);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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 array('db' => 'external_tokens', 'restore' => base::NOT_MAPPED);
|
||||
}
|
||||
|
||||
public static function get_other_mapping() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -73,4 +73,9 @@ class webservice_token_sent extends base {
|
||||
$this->data['edulevel'] = self::LEVEL_OTHER;
|
||||
$this->data['objecttable'] = 'external_tokens';
|
||||
}
|
||||
|
||||
public static function get_objectid_mapping() {
|
||||
// Webservices are not included in backups.
|
||||
return array('db' => 'external_tokens', 'restore' => base::NOT_MAPPED);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user