Esempio n. 1
0
 public function get_events_select($selectwhere, array $params, $sort, $limitfrom, $limitnum)
 {
     global $DB;
     $sort = self::tweak_sort_by_id($sort);
     // Replace the query with hardcoded mappings required for core.
     list($selectwhere, $params, $sort) = self::replace_sql_legacy($selectwhere, $params, $sort);
     $events = array();
     $records = array();
     try {
         $records = $DB->get_records_select('log', $selectwhere, $params, $sort, '*', $limitfrom, $limitnum);
     } catch (\moodle_exception $ex) {
         debugging("error converting legacy event data " . $ex->getMessage() . $ex->debuginfo, DEBUG_DEVELOPER);
     }
     foreach ($records as $data) {
         $events[$data->id] = \logstore_legacy\event\legacy_logged::restore_legacy($data);
     }
     return $events;
 }
Esempio n. 2
0
 /**
  * Returns an event from the log data.
  *
  * @param stdClass $data Log data
  * @return \core\event\base
  */
 public function get_log_event($data)
 {
     return \logstore_legacy\event\legacy_logged::restore_legacy($data);
 }