/** * Returns an associative array of LogEntry types * * @param bool whether to force a refresh of the cached values * @return array An array of log entry type names => integer values */ public static function list_logentry_types($force = false) { if ($force || empty(self::$types)) { self::$types = array(); $res = DB::get_results('SELECT id, module, type FROM {log_types}'); foreach ($res as $x) { self::$types[$x->module][$x->type] = $x->id; } } return self::$types; }