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

@ -126,4 +126,15 @@ class assessable_uploaded extends \core\event\assessable_uploaded {
throw new \coding_exception('The \'triggeredfrom\' value must be set in other.');
}
}
public static function get_objectid_mapping() {
return array('db' => 'forum_posts', 'restore' => 'forum_post');
}
public static function get_other_mapping() {
$othermapped = array();
$othermapped['discussionid'] = array('db' => 'forum_discussions', 'restore' => 'forum_discussion');
return $othermapped;
}
}

View file

@ -66,5 +66,8 @@ class course_module_viewed extends \core\event\course_module_viewed {
$this->objectid, $this->contextinstanceid);
}
public static function get_objectid_mapping() {
return array('db' => 'forum', 'restore' => 'forum');
}
}

View file

@ -111,5 +111,8 @@ class course_searched extends \core\event\base {
}
}
public static function get_other_mapping() {
return false;
}
}

View file

@ -109,4 +109,15 @@ class discussion_created extends \core\event\base {
throw new \coding_exception('Context level must be CONTEXT_MODULE.');
}
}
public static function get_objectid_mapping() {
return array('db' => 'forum_discussions', 'restore' => 'forum_discussion');
}
public static function get_other_mapping() {
$othermapped = array();
$othermapped['forumid'] = array('db' => 'forum', 'restore' => 'forum');
return $othermapped;
}
}

View file

@ -107,5 +107,16 @@ class discussion_deleted extends \core\event\base {
throw new \coding_exception('Context level must be CONTEXT_MODULE.');
}
}
public static function get_objectid_mapping() {
return array('db' => 'forum_discussions', 'restore' => 'forum_discussion');
}
public static function get_other_mapping() {
$othermapped = array();
$othermapped['forumid'] = array('db' => 'forum', 'restore' => 'forum');
return $othermapped;
}
}

View file

@ -111,4 +111,16 @@ class discussion_moved extends \core\event\base {
throw new \coding_exception('Context level must be CONTEXT_MODULE.');
}
}
public static function get_objectid_mapping() {
return array('db' => 'forum_discussions', 'restore' => 'forum_discussion');
}
public static function get_other_mapping() {
$othermapped = array();
$othermapped['fromforumid'] = array('db' => 'forum', 'restore' => 'forum');
$othermapped['toforumid'] = array('db' => 'forum', 'restore' => 'forum');
return $othermapped;
}
}

View file

@ -109,4 +109,16 @@ class discussion_subscription_created extends \core\event\base {
throw new \coding_exception('Context level must be CONTEXT_MODULE.');
}
}
public static function get_objectid_mapping() {
return array('db' => 'forum_discussion_subs', 'restore' => 'forum_discussion_sub');
}
public static function get_other_mapping() {
$othermapped = array();
$othermapped['forumid'] = array('db' => 'forum', 'restore' => 'forum');
$othermapped['discussion'] = array('db' => 'forum_discussions', 'restore' => 'forum_discussion');
return $othermapped;
}
}

View file

@ -109,4 +109,16 @@ class discussion_subscription_deleted extends \core\event\base {
throw new \coding_exception('Context level must be CONTEXT_MODULE.');
}
}
public static function get_objectid_mapping() {
return array('db' => 'forum_discussion_subs', 'restore' => 'forum_discussion_sub');
}
public static function get_other_mapping() {
$othermapped = array();
$othermapped['forumid'] = array('db' => 'forum', 'restore' => 'forum');
$othermapped['discussion'] = array('db' => 'forum_discussions', 'restore' => 'forum_discussion');
return $othermapped;
}
}

View file

@ -97,4 +97,15 @@ class discussion_updated extends \core\event\base {
throw new \coding_exception('Context level must be CONTEXT_MODULE.');
}
}
public static function get_objectid_mapping() {
return array('db' => 'forum_discussions', 'restore' => 'forum_discussion');
}
public static function get_other_mapping() {
$othermapped = array();
$othermapped['forumid'] = array('db' => 'forum', 'restore' => 'forum');
return $othermapped;
}
}

View file

@ -99,5 +99,8 @@ class discussion_viewed extends \core\event\base {
}
}
public static function get_objectid_mapping() {
return array('db' => 'forum_discussions', 'restore' => 'forum_discussion');
}
}

View file

@ -128,4 +128,16 @@ class post_created extends \core\event\base {
throw new \coding_exception('Context level must be CONTEXT_MODULE.');
}
}
public static function get_objectid_mapping() {
return array('db' => 'forum_posts', 'restore' => 'forum_post');
}
public static function get_other_mapping() {
$othermapped = array();
$othermapped['forumid'] = array('db' => 'forum', 'restore' => 'forum');
$othermapped['discussionid'] = array('db' => 'forum_discussions', 'restore' => 'forum_discussion');
return $othermapped;
}
}

View file

@ -127,4 +127,16 @@ class post_deleted extends \core\event\base {
throw new \coding_exception('Context level must be CONTEXT_MODULE.');
}
}
public static function get_objectid_mapping() {
return array('db' => 'forum_posts', 'restore' => 'forum_post');
}
public static function get_other_mapping() {
$othermapped = array();
$othermapped['forumid'] = array('db' => 'forum', 'restore' => 'forum');
$othermapped['discussionid'] = array('db' => 'forum_discussions', 'restore' => 'forum_discussion');
return $othermapped;
}
}

View file

@ -128,4 +128,16 @@ class post_updated extends \core\event\base {
throw new \coding_exception('Context level must be CONTEXT_MODULE.');
}
}
public static function get_objectid_mapping() {
return array('db' => 'forum_posts', 'restore' => 'forum_post');
}
public static function get_other_mapping() {
$othermapped = array();
$othermapped['forumid'] = array('db' => 'forum', 'restore' => 'forum');
$othermapped['discussionid'] = array('db' => 'forum_discussions', 'restore' => 'forum_discussion');
return $othermapped;
}
}

View file

@ -110,4 +110,11 @@ class readtracking_disabled extends \core\event\base {
throw new \coding_exception('Context level must be CONTEXT_MODULE.');
}
}
public static function get_other_mapping() {
$othermapped = array();
$othermapped['forumid'] = array('db' => 'forum', 'restore' => 'forum');
return $othermapped;
}
}

View file

@ -110,4 +110,11 @@ class readtracking_enabled extends \core\event\base {
throw new \coding_exception('Context level must be CONTEXT_MODULE.');
}
}
public static function get_other_mapping() {
$othermapped = array();
$othermapped['forumid'] = array('db' => 'forum', 'restore' => 'forum');
return $othermapped;
}
}

View file

@ -108,5 +108,11 @@ class subscribers_viewed extends \core\event\base {
}
}
public static function get_other_mapping() {
$othermapped = array();
$othermapped['forumid'] = array('db' => 'forum', 'restore' => 'forum');
return $othermapped;
}
}

View file

@ -111,4 +111,15 @@ class subscription_created extends \core\event\base {
throw new \coding_exception('Context level must be CONTEXT_MODULE.');
}
}
public static function get_objectid_mapping() {
return array('db' => 'forum_subscriptions', 'restore' => 'forum_subscription');
}
public static function get_other_mapping() {
$othermapped = array();
$othermapped['forumid'] = array('db' => 'forum', 'restore' => 'forum');
return $othermapped;
}
}

View file

@ -111,4 +111,15 @@ class subscription_deleted extends \core\event\base {
throw new \coding_exception('Context level must be CONTEXT_MODULE.');
}
}
public static function get_objectid_mapping() {
return array('db' => 'forum_subscriptions', 'restore' => 'forum_subscription');
}
public static function get_other_mapping() {
$othermapped = array();
$othermapped['forumid'] = array('db' => 'forum', 'restore' => 'forum');
return $othermapped;
}
}

View file

@ -128,5 +128,8 @@ class user_report_viewed extends \core\event\base {
}
}
public static function get_other_mapping() {
return false;
}
}