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

@ -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');
}
}