Fix #231 set objectid mapping to attendance id.
authorDan Marsden <dan@danmarsden.com>
Wed, 30 Nov 2016 09:03:22 +0000 (22:03 +1300)
committerDan Marsden <dan@danmarsden.com>
Wed, 30 Nov 2016 09:03:22 +0000 (22:03 +1300)
classes/event/attendance_taken.php
classes/event/attendance_taken_by_student.php
classes/event/report_viewed.php
classes/event/session_added.php
classes/event/session_deleted.php
classes/event/session_duration_updated.php
classes/event/session_updated.php
classes/event/status_added.php
classes/event/status_removed.php
classes/event/status_updated.php

index d001a27..5c9385e 100644 (file)
@@ -90,6 +90,15 @@ class attendance_taken extends \core\event\base {
     }
 
     /**
+     * Get objectid mapping
+     *
+     * @return array of parameters for object mapping.
+     */
+    public static function get_objectid_mapping() {
+        return array('db' => 'attendance', 'restore' => 'attendance');
+    }
+
+    /**
      * Custom validation.
      *
      * @throws \coding_exception
index 8cb2b55..3335cdf 100644 (file)
@@ -90,6 +90,15 @@ class attendance_taken_by_student extends \core\event\base {
     }
 
     /**
+     * Get objectid mapping
+     *
+     * @return array of parameters for object mapping.
+     */
+    public static function get_objectid_mapping() {
+        return array('db' => 'attendance', 'restore' => 'attendance');
+    }
+
+    /**
      * Custom validation.
      *
      * @throws \coding_exception
index cadfd3b..6b64a50 100644 (file)
@@ -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');
+    }
+
 }
index db33ace..d734345 100644 (file)
@@ -88,6 +88,15 @@ class session_added extends \core\event\base {
     }
 
     /**
+     * Get objectid mapping
+     *
+     * @return array of parameters for object mapping.
+     */
+    public static function get_objectid_mapping() {
+        return array('db' => 'attendance', 'restore' => 'attendance');
+    }
+
+    /**
      * Custom validation.
      *
      * @throws \coding_exception
index 2cf29a5..576d1a2 100644 (file)
@@ -88,6 +88,15 @@ class session_deleted extends \core\event\base {
     }
 
     /**
+     * Get objectid mapping
+     *
+     * @return array of parameters for object mapping.
+     */
+    public static function get_objectid_mapping() {
+        return array('db' => 'attendance', 'restore' => 'attendance');
+    }
+
+    /**
      * Custom validation.
      *
      * @throws \coding_exception
index fbbaf56..0e43364 100644 (file)
@@ -88,6 +88,15 @@ class session_duration_updated extends \core\event\base {
     }
 
     /**
+     * Get objectid mapping
+     *
+     * @return array of parameters for object mapping.
+     */
+    public static function get_objectid_mapping() {
+        return array('db' => 'attendance', 'restore' => 'attendance');
+    }
+
+    /**
      * Custom validation.
      *
      * @throws \coding_exception
index cab8e51..efa5e62 100644 (file)
@@ -90,6 +90,15 @@ class session_updated extends \core\event\base {
     }
 
     /**
+     * Get objectid mapping
+     *
+     * @return array of parameters for object mapping.
+     */
+    public static function get_objectid_mapping() {
+        return array('db' => 'attendance', 'restore' => 'attendance');
+    }
+
+    /**
      * Custom validation.
      *
      * @throws \coding_exception
index 8a855c1..b411370 100644 (file)
@@ -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');
+    }
+
 }
index a32ad7a..5f3814b 100644 (file)
@@ -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');
+    }
+
 }
index 2a2caee..1934b54 100644 (file)
@@ -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');
+    }
+
 }