From 10a69b6fb338b37ab32030284096bf035d71e9f7 Mon Sep 17 00:00:00 2001 From: Dan Marsden Date: Wed, 30 Nov 2016 22:03:22 +1300 Subject: [PATCH] Fix #231 set objectid mapping to attendance id. --- classes/event/attendance_taken.php | 9 +++++++++ classes/event/attendance_taken_by_student.php | 9 +++++++++ classes/event/report_viewed.php | 10 ++++++++++ classes/event/session_added.php | 9 +++++++++ classes/event/session_deleted.php | 9 +++++++++ classes/event/session_duration_updated.php | 9 +++++++++ classes/event/session_updated.php | 9 +++++++++ classes/event/status_added.php | 10 ++++++++++ classes/event/status_removed.php | 10 ++++++++++ classes/event/status_updated.php | 10 ++++++++++ 10 files changed, 94 insertions(+) diff --git a/classes/event/attendance_taken.php b/classes/event/attendance_taken.php index d001a27..5c9385e 100644 --- a/classes/event/attendance_taken.php +++ b/classes/event/attendance_taken.php @@ -89,6 +89,15 @@ class attendance_taken extends \core\event\base { '', $this->contextinstanceid); } + /** + * Get objectid mapping + * + * @return array of parameters for object mapping. + */ + public static function get_objectid_mapping() { + return array('db' => 'attendance', 'restore' => 'attendance'); + } + /** * Custom validation. * diff --git a/classes/event/attendance_taken_by_student.php b/classes/event/attendance_taken_by_student.php index 8cb2b55..3335cdf 100644 --- a/classes/event/attendance_taken_by_student.php +++ b/classes/event/attendance_taken_by_student.php @@ -89,6 +89,15 @@ class attendance_taken_by_student extends \core\event\base { '', $this->contextinstanceid); } + /** + * Get objectid mapping + * + * @return array of parameters for object mapping. + */ + public static function get_objectid_mapping() { + return array('db' => 'attendance', 'restore' => 'attendance'); + } + /** * Custom validation. * diff --git a/classes/event/report_viewed.php b/classes/event/report_viewed.php index cadfd3b..6b64a50 100644 --- a/classes/event/report_viewed.php +++ b/classes/event/report_viewed.php @@ -86,4 +86,14 @@ class report_viewed extends \core\event\base { return array($this->courseid, 'attendance', 'report', 'report.php?id=' . $this->objectid, $this->objectid, $this->contextinstanceid); } + + /** + * Get objectid mapping + * + * @return array of parameters for object mapping. + */ + public static function get_objectid_mapping() { + return array('db' => 'attendance', 'restore' => 'attendance'); + } + } diff --git a/classes/event/session_added.php b/classes/event/session_added.php index db33ace..d734345 100644 --- a/classes/event/session_added.php +++ b/classes/event/session_added.php @@ -87,6 +87,15 @@ class session_added extends \core\event\base { $this->other['info'], $this->contextinstanceid); } + /** + * Get objectid mapping + * + * @return array of parameters for object mapping. + */ + public static function get_objectid_mapping() { + return array('db' => 'attendance', 'restore' => 'attendance'); + } + /** * Custom validation. * diff --git a/classes/event/session_deleted.php b/classes/event/session_deleted.php index 2cf29a5..576d1a2 100644 --- a/classes/event/session_deleted.php +++ b/classes/event/session_deleted.php @@ -87,6 +87,15 @@ class session_deleted extends \core\event\base { $this->other['info'], $this->contextinstanceid); } + /** + * Get objectid mapping + * + * @return array of parameters for object mapping. + */ + public static function get_objectid_mapping() { + return array('db' => 'attendance', 'restore' => 'attendance'); + } + /** * Custom validation. * diff --git a/classes/event/session_duration_updated.php b/classes/event/session_duration_updated.php index fbbaf56..0e43364 100644 --- a/classes/event/session_duration_updated.php +++ b/classes/event/session_duration_updated.php @@ -87,6 +87,15 @@ class session_duration_updated extends \core\event\base { $this->other['info'], $this->contextinstanceid); } + /** + * Get objectid mapping + * + * @return array of parameters for object mapping. + */ + public static function get_objectid_mapping() { + return array('db' => 'attendance', 'restore' => 'attendance'); + } + /** * Custom validation. * diff --git a/classes/event/session_updated.php b/classes/event/session_updated.php index cab8e51..efa5e62 100644 --- a/classes/event/session_updated.php +++ b/classes/event/session_updated.php @@ -89,6 +89,15 @@ class session_updated extends \core\event\base { $this->other['info'], $this->contextinstanceid); } + /** + * Get objectid mapping + * + * @return array of parameters for object mapping. + */ + public static function get_objectid_mapping() { + return array('db' => 'attendance', 'restore' => 'attendance'); + } + /** * Custom validation. * diff --git a/classes/event/status_added.php b/classes/event/status_added.php index 8a855c1..b411370 100644 --- a/classes/event/status_added.php +++ b/classes/event/status_added.php @@ -86,4 +86,14 @@ class status_added extends \core\event\base { return array($this->courseid, 'attendance', 'status added', $this->get_url(), $this->other['acronym'].': '.$this->other['description'].' ('.$this->other['grade'].')', $this->contextinstanceid); } + + /** + * Get objectid mapping + * + * @return array of parameters for object mapping. + */ + public static function get_objectid_mapping() { + return array('db' => 'attendance', 'restore' => 'attendance'); + } + } diff --git a/classes/event/status_removed.php b/classes/event/status_removed.php index a32ad7a..5f3814b 100644 --- a/classes/event/status_removed.php +++ b/classes/event/status_removed.php @@ -88,4 +88,14 @@ class status_removed extends \core\event\base { return array($this->courseid, 'attendance', 'status removed', $this->get_url(), $this->other['acronym'] . ' - ' . $this->other['description'], $this->contextinstanceid); } + + /** + * Get objectid mapping + * + * @return array of parameters for object mapping. + */ + public static function get_objectid_mapping() { + return array('db' => 'attendance', 'restore' => 'attendance'); + } + } diff --git a/classes/event/status_updated.php b/classes/event/status_updated.php index 2a2caee..1934b54 100644 --- a/classes/event/status_updated.php +++ b/classes/event/status_updated.php @@ -86,4 +86,14 @@ class status_updated extends \core\event\base { return array($this->courseid, 'attendance', 'status updated', $this->get_url(), $this->other['updated'], $this->contextinstanceid); } + + /** + * Get objectid mapping + * + * @return array of parameters for object mapping. + */ + public static function get_objectid_mapping() { + return array('db' => 'attendance', 'restore' => 'attendance'); + } + }