Habari\LogEntry::list_logentry_types PHP Method

list_logentry_types() public static method

Returns an associative array of LogEntry types
public static list_logentry_types ( boolean $force = false ) : array
$force boolean 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;
    }