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;
}
}

View file

@ -108,4 +108,7 @@ class chapter_created extends \core\event\base {
$this->data['objecttable'] = 'book_chapters';
}
public static function get_objectid_mapping() {
return array('db' => 'book_chapters', 'restore' => 'book_chapter');
}
}

View file

@ -104,4 +104,8 @@ class chapter_deleted extends \core\event\base {
$this->data['edulevel'] = self::LEVEL_TEACHING;
$this->data['objecttable'] = 'book_chapters';
}
public static function get_objectid_mapping() {
return array('db' => 'book_chapters', 'restore' => 'book_chapter');
}
}

View file

@ -108,4 +108,7 @@ class chapter_updated extends \core\event\base {
$this->data['objecttable'] = 'book_chapters';
}
public static function get_objectid_mapping() {
return array('db' => 'book_chapters', 'restore' => 'book_chapter');
}
}

View file

@ -104,4 +104,8 @@ class chapter_viewed extends \core\event\base {
$this->data['edulevel'] = self::LEVEL_PARTICIPATING;
$this->data['objecttable'] = 'book_chapters';
}
public static function get_objectid_mapping() {
return array('db' => 'book_chapters', 'restore' => 'book_chapter');
}
}

View file

@ -64,4 +64,8 @@ class course_module_viewed extends \core\event\course_module_viewed {
$this->data['edulevel'] = self::LEVEL_PARTICIPATING;
$this->data['objecttable'] = 'book';
}
public static function get_objectid_mapping() {
return array('db' => 'book', 'restore' => 'book');
}
}

View file

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

View file

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

View file

@ -102,7 +102,10 @@ class chapter_printed extends \core\event\base {
protected function init() {
$this->data['crud'] = 'r';
$this->data['edulevel'] = self::LEVEL_PARTICIPATING;
$this->data['objecttable'] = 'book';
$this->data['objecttable'] = 'book_chapters';
}
public static function get_objectid_mapping() {
return array('db' => 'book_chapters', 'restore' => 'book_chapter');
}
}

View file

@ -40,4 +40,8 @@ class course_module_viewed extends \core\event\course_module_viewed {
$this->data['edulevel'] = self::LEVEL_PARTICIPATING;
$this->data['objecttable'] = 'chat';
}
public static function get_objectid_mapping() {
return array('db' => 'chat', 'restore' => 'chat');
}
}

View file

@ -97,4 +97,8 @@ class message_sent extends \core\event\base {
throw new \coding_exception('The \'relateduserid\' must be set.');
}
}
public static function get_objectid_mapping() {
return array('db' => 'chat_messages', 'restore' => 'chat_message');
}
}

View file

@ -107,4 +107,12 @@ class sessions_viewed extends \core\event\base {
}
}
public static function get_objectid_mapping() {
return array('db' => 'chat', 'restore' => 'chat');
}
public static function get_other_mapping() {
// Nothing to map.
return false;
}
}

View file

@ -93,6 +93,10 @@ class answer_submitted extends \core\event\base {
* @return void
*/
protected function init() {
// The objecttable here is wrong. We are submitting an answer, not a choice activity.
// This also makes the description misleading as it states we made a choice with id
// '$this->objectid' which just refers to the 'choice' table. The trigger for
// this event should be triggered after we insert to the 'choice_answers' table.
$this->data['crud'] = 'c';
$this->data['edulevel'] = self::LEVEL_PARTICIPATING;
$this->data['objecttable'] = 'choice';
@ -111,4 +115,22 @@ class answer_submitted extends \core\event\base {
throw new \coding_exception('The \'choiceid\' value must be set in other.');
}
}
public static function get_objectid_mapping() {
return array('db' => 'choice', 'restore' => 'choice');
}
public static function get_other_mapping() {
$othermapped = array();
$othermapped['choiceid'] = array('db' => 'choice', 'restore' => 'choice');
// The 'optionid' is being passed as an array, so we can't map it. The event is
// triggered each time a choice is answered, where it may be possible to select
// multiple choices, so the value is converted to an array, which is then passed
// to the event. Ideally this event should be triggered every time we insert to the
// 'choice_answers' table so this will only be an int.
// $othermapped['optionid'] = array('db' => 'choice_options', 'restore' => 'choice_option');
return $othermapped;
}
}

View file

@ -93,6 +93,10 @@ class answer_updated extends \core\event\base {
* @return void
*/
protected function init() {
// The objecttable here is wrong. We are updating an answer, not a choice activity.
// This also makes the description misleading as it states we made a choice with id
// '$this->objectid' which just refers to the 'choice' table. The trigger for
// this event should be triggered after we update the 'choice_answers' table.
$this->data['crud'] = 'u';
$this->data['edulevel'] = self::LEVEL_PARTICIPATING;
$this->data['objecttable'] = 'choice';
@ -111,4 +115,22 @@ class answer_updated extends \core\event\base {
throw new \coding_exception('The \'choiceid\' value must be set in other.');
}
}
public static function get_objectid_mapping() {
return array('db' => 'choice', 'restore' => 'choice');
}
public static function get_other_mapping() {
$othermapped = array();
$othermapped['choiceid'] = array('db' => 'choice', 'restore' => 'choice');
// The 'optionid' is being passed as an array, so we can't map it. The event is
// triggered each time a choice is answered, where it may be possible to select
// multiple choices, so the value is converted to an array, which is then passed
// to the event. Ideally this event should be triggered every time we update the
// 'choice_answers' table so this will only be an int.
// $othermapped['optionid'] = array('db' => 'choice_options', 'restore' => 'choice_option');
return $othermapped;
}
}

View file

@ -43,4 +43,8 @@ class course_module_viewed extends \core\event\course_module_viewed {
$this->data['edulevel'] = self::LEVEL_PARTICIPATING;
$this->data['objecttable'] = 'choice';
}
public static function get_objectid_mapping() {
return array('db' => 'choice', 'restore' => 'choice');
}
}

View file

@ -80,4 +80,8 @@ class report_viewed extends \core\event\base {
$url = new \moodle_url('report.php', array('id' => $this->contextinstanceid));
return array($this->courseid, 'choice', 'report', $url->out(), $this->objectid, $this->contextinstanceid);
}
public static function get_objectid_mapping() {
return array('db' => 'choice', 'restore' => 'choice');
}
}

View file

@ -47,4 +47,8 @@ class course_module_viewed extends \core\event\course_module_viewed {
$this->data['crud'] = 'r';
$this->data['edulevel'] = self::LEVEL_PARTICIPATING;
}
public static function get_objectid_mapping() {
return array('db' => 'data', 'restore' => 'data');
}
}

View file

@ -110,4 +110,15 @@ class field_created extends \core\event\base {
throw new \coding_exception('The \'dataid\' value must be set in other.');
}
}
public static function get_objectid_mapping() {
return array('db' => 'data_fields', 'restore' => 'data_field');
}
public static function get_other_mapping() {
$othermapped = array();
$othermapped['dataid'] = array('db' => 'data', 'restore' => 'data');
return $othermapped;
}
}

View file

@ -109,4 +109,15 @@ class field_deleted extends \core\event\base {
throw new \coding_exception('The \'dataid\' value must be set in other.');
}
}
public static function get_objectid_mapping() {
return array('db' => 'data_fields', 'restore' => 'data_field');
}
public static function get_other_mapping() {
$othermapped = array();
$othermapped['dataid'] = array('db' => 'data', 'restore' => 'data');
return $othermapped;
}
}

View file

@ -109,4 +109,15 @@ class field_updated extends \core\event\base {
throw new \coding_exception('The \'dataid\' value must be set in other.');
}
}
public static function get_objectid_mapping() {
return array('db' => 'data_fields', 'restore' => 'data_field');
}
public static function get_other_mapping() {
$othermapped = array();
$othermapped['dataid'] = array('db' => 'data', 'restore' => 'data');
return $othermapped;
}
}

View file

@ -104,4 +104,15 @@ class record_created extends \core\event\base {
throw new \coding_exception('The \'dataid\' value must be set in other.');
}
}
public static function get_objectid_mapping() {
return array('db' => 'data_records', 'restore' => 'data_record');
}
public static function get_other_mapping() {
$othermapped = array();
$othermapped['dataid'] = array('db' => 'data', 'restore' => 'data');
return $othermapped;
}
}

View file

@ -104,4 +104,15 @@ class record_deleted extends \core\event\base {
throw new \coding_exception('The \'dataid\' value must be set in other.');
}
}
public static function get_objectid_mapping() {
return array('db' => 'data_records', 'restore' => 'data_record');
}
public static function get_other_mapping() {
$othermapped = array();
$othermapped['dataid'] = array('db' => 'data', 'restore' => 'data');
return $othermapped;
}
}

View file

@ -104,4 +104,15 @@ class record_updated extends \core\event\base {
throw new \coding_exception('The \'dataid\' value must be set in other.');
}
}
public static function get_objectid_mapping() {
return array('db' => 'data_records', 'restore' => 'data_record');
}
public static function get_other_mapping() {
$othermapped = array();
$othermapped['dataid'] = array('db' => 'data', 'restore' => 'data');
return $othermapped;
}
}

View file

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

View file

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

View file

@ -98,5 +98,9 @@ class course_module_viewed extends \core\event\course_module_viewed {
throw new \coding_exception('The \'anonymous\' value must be set in other.');
}
}
public static function get_objectid_mapping() {
return array('db' => 'feedback', 'restore' => 'feedback');
}
}

View file

@ -126,5 +126,17 @@ class response_deleted extends \core\event\base {
throw new \coding_exception('The \'instanceid\' value must be set in other.');
}
}
public static function get_objectid_mapping() {
return array('db' => 'feedback_completed', 'restore' => 'feedback_completed');
}
public static function get_other_mapping() {
$othermapped = array();
$othermapped['cmid'] = array('db' => 'course_modules', 'restore' => 'course_module');
$othermapped['instanceid'] = array('db' => 'feedback', 'restore' => 'feedback');
return $othermapped;
}
}

View file

@ -148,5 +148,17 @@ class response_submitted extends \core\event\base {
throw new \coding_exception('The \'instanceid\' value must be set in other.');
}
}
public static function get_objectid_mapping() {
return array('db' => 'feedback_completed', 'restore' => 'feedback_completed');
}
public static function get_other_mapping() {
$othermapped = array();
$othermapped['cmid'] = array('db' => 'course_modules', 'restore' => 'course_module');
$othermapped['instanceid'] = array('db' => 'feedback', 'restore' => 'feedback');
return $othermapped;
}
}

View file

@ -44,4 +44,8 @@ class course_module_viewed extends \core\event\course_module_viewed {
$this->data['edulevel'] = self::LEVEL_PARTICIPATING;
$this->data['objecttable'] = 'folder';
}
public static function get_objectid_mapping() {
return array('db' => 'folder', 'restore' => 'folder');
}
}

View file

@ -81,4 +81,8 @@ class folder_updated extends \core\event\base {
return array($this->courseid, 'folder', 'edit', 'edit.php?id=' . $this->contextinstanceid, $this->objectid,
$this->contextinstanceid);
}
public static function get_objectid_mapping() {
return array('db' => 'folder', 'restore' => 'folder');
}
}

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;
}
}

View file

@ -96,5 +96,9 @@ class category_created extends \core\event\base {
throw new \coding_exception('Context level must be CONTEXT_MODULE.');
}
}
public static function get_objectid_mapping() {
return array('db' => 'glossary_categories', 'restore' => 'glossary_category');
}
}

View file

@ -96,5 +96,9 @@ class category_deleted extends \core\event\base {
throw new \coding_exception('Context level must be CONTEXT_MODULE.');
}
}
public static function get_objectid_mapping() {
return array('db' => 'glossary_categories', 'restore' => 'glossary_category');
}
}

View file

@ -96,5 +96,9 @@ class category_updated extends \core\event\base {
throw new \coding_exception('Context level must be CONTEXT_MODULE.');
}
}
public static function get_objectid_mapping() {
return array('db' => 'glossary_categories', 'restore' => 'glossary_category');
}
}

View file

@ -28,6 +28,12 @@ defined('MOODLE_INTERNAL') || die();
/**
* The mod_glossary course module viewed event class.
*
* @property-read array $other {
* Extra information about event.
*
* - string mode: (optional)
* }
*
* @package mod_glossary
* @since Moodle 2.7
* @copyright 2014 Marina Glancy
@ -68,4 +74,13 @@ class course_module_viewed extends \core\event\course_module_viewed {
'view.php?id=' . $this->contextinstanceid . '&tab=-1',
$this->objectid, $this->contextinstanceid);
}
public static function get_objectid_mapping() {
return array('db' => 'glossary', 'restore' => 'glossary');
}
public static function get_other_mapping() {
// Nothing to map.
return false;
}
}

View file

@ -98,5 +98,9 @@ class entry_approved extends \core\event\base {
throw new \coding_exception('Context level must be CONTEXT_MODULE.');
}
}
public static function get_objectid_mapping() {
return array('db' => 'glossary_entries', 'restore' => 'glossary_entry');
}
}

View file

@ -104,5 +104,14 @@ class entry_created extends \core\event\base {
throw new \coding_exception('Context level must be CONTEXT_MODULE.');
}
}
public static function get_objectid_mapping() {
return array('db' => 'glossary_entries', 'restore' => 'glossary_entry');
}
public static function get_other_mapping() {
// Nothing to map.
return false;
}
}

View file

@ -118,5 +118,14 @@ class entry_deleted extends \core\event\base {
throw new \coding_exception('Context level must be CONTEXT_MODULE.');
}
}
public static function get_objectid_mapping() {
return array('db' => 'glossary_entries', 'restore' => 'glossary_entry');
}
public static function get_other_mapping() {
// Nothing to map.
return false;
}
}

View file

@ -98,5 +98,9 @@ class entry_disapproved extends \core\event\base {
throw new \coding_exception('Context level must be CONTEXT_MODULE.');
}
}
public static function get_objectid_mapping() {
return array('db' => 'glossary_entries', 'restore' => 'glossary_entry');
}
}

View file

@ -104,5 +104,14 @@ class entry_updated extends \core\event\base {
throw new \coding_exception('Context level must be CONTEXT_MODULE.');
}
}
public static function get_objectid_mapping() {
return array('db' => 'glossary_entries', 'restore' => 'glossary_entry');
}
public static function get_other_mapping() {
// Nothing to map.
return false;
}
}

View file

@ -98,5 +98,9 @@ class entry_viewed extends \core\event\base {
throw new \coding_exception('Context level must be CONTEXT_MODULE.');
}
}
public static function get_objectid_mapping() {
return array('db' => 'glossary_entries', 'restore' => 'glossary_entry');
}
}

View file

@ -45,4 +45,8 @@ class course_module_viewed extends \core\event\course_module_viewed {
$this->data['crud'] = 'r';
$this->data['edulevel'] = self::LEVEL_PARTICIPATING;
}
public static function get_objectid_mapping() {
return array('db' => 'imscp', 'restore' => 'imscp');
}
}

View file

@ -86,4 +86,8 @@ class content_page_viewed extends \core\event\base {
throw new \coding_exception('Context level must be CONTEXT_MODULE.');
}
}
public static function get_objectid_mapping() {
return array('db' => 'lesson_pages', 'restore' => 'lesson_page');
}
}

View file

@ -45,4 +45,8 @@ class course_module_viewed extends \core\event\course_module_viewed {
$this->data['crud'] = 'r';
$this->data['edulevel'] = self::LEVEL_PARTICIPATING;
}
public static function get_objectid_mapping() {
return array('db' => 'lesson', 'restore' => 'lesson');
}
}

View file

@ -111,4 +111,16 @@ class essay_assessed extends \core\event\base {
throw new \coding_exception('The \'attemptid\' value must be set in other.');
}
}
public static function get_objectid_mapping() {
return array('db' => 'lesson_grades', 'restore' => 'lesson_grade');
}
public static function get_other_mapping() {
$othermapped = array();
$othermapped['lessonid'] = array('db' => 'lesson', 'restore' => 'lesson');
$othermapped['attemptid'] = array('db' => 'lesson_attempts', 'restore' => 'lesson_attept');
return $othermapped;
}
}

View file

@ -97,4 +97,8 @@ class essay_attempt_viewed extends \core\event\base {
throw new \coding_exception('The \'relateduserid\' must be set.');
}
}
public static function get_objectid_mapping() {
return array('db' => 'lesson_attempts', 'restore' => 'lesson_attempt');
}
}

View file

@ -97,4 +97,16 @@ class group_override_created extends \core\event\base {
throw new \coding_exception('The \'groupid\' value must be set in other.');
}
}
public static function get_objectid_mapping() {
return array('db' => 'lesson_overrides', 'restore' => 'lesson_override');
}
public static function get_other_mapping() {
$othermapped = array();
$othermapped['lessonid'] = array('db' => 'lesson', 'restore' => 'lesson');
$othermapped['groupid'] = array('db' => 'groups', 'restore' => 'group');
return $othermapped;
}
}

View file

@ -96,4 +96,16 @@ class group_override_deleted extends \core\event\base {
throw new \coding_exception('The \'groupid\' value must be set in other.');
}
}
public static function get_objectid_mapping() {
return array('db' => 'lesson_overrides', 'restore' => 'lesson_override');
}
public static function get_other_mapping() {
$othermapped = array();
$othermapped['lessonid'] = array('db' => 'lesson', 'restore' => 'lesson');
$othermapped['groupid'] = array('db' => 'groups', 'restore' => 'group');
return $othermapped;
}
}

View file

@ -96,4 +96,16 @@ class group_override_updated extends \core\event\base {
throw new \coding_exception('The \'groupid\' value must be set in other.');
}
}
public static function get_objectid_mapping() {
return array('db' => 'lesson_overrides', 'restore' => 'lesson_override');
}
public static function get_other_mapping() {
$othermapped = array();
$othermapped['lessonid'] = array('db' => 'lesson', 'restore' => 'lesson');
$othermapped['groupid'] = array('db' => 'groups', 'restore' => 'group');
return $othermapped;
}
}

View file

@ -111,4 +111,14 @@ class highscore_added extends \core\event\base {
throw new \coding_exception('The \'nickname\' value must be set in other.');
}
}
public static function get_objectid_mapping() {
// The 'highscore' functionality was removed from core.
return false;
}
public static function get_other_mapping() {
// The 'highscore' functionality was removed from core.
return false;
}
}

View file

@ -87,4 +87,14 @@ class highscores_viewed extends \core\event\base {
return array($this->courseid, 'lesson', 'view highscores', 'highscores.php?id=' . $this->contextinstanceid,
$lesson->name, $this->contextinstanceid);
}
public static function get_objectid_mapping() {
// The 'highscore' functionality was removed from core.
return false;
}
public static function get_other_mapping() {
// The 'highscore' functionality was removed from core.
return false;
}
}

View file

@ -82,4 +82,8 @@ class lesson_ended extends \core\event\base {
return array($this->courseid, 'lesson', 'end', 'view.php?id=' . $this->contextinstanceid, $this->objectid,
$this->contextinstanceid);
}
public static function get_objectid_mapping() {
return array('db' => 'lesson', 'restore' => 'lesson');
}
}

View file

@ -72,4 +72,8 @@ class lesson_restarted extends \core\event\base {
return "The user with id '$this->userid' abandoned their previous incomplete attempt ".
"and started a new attempt on the lesson with course module id '$this->contextinstanceid'.";
}
public static function get_objectid_mapping() {
return array('db' => 'lesson', 'restore' => 'lesson');
}
}

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