Habari\Comment::list_comment_types PHP Method

list_comment_types() public static method

Obtain an associative array of comment types
public static list_comment_types ( boolean $refresh = false ) : array
$refresh boolean Whether to force a refresh of the cached values
return array An array mapping comment type names to integer values
    public static function list_comment_types($refresh = false)
    {
        if ($refresh || empty(self::$comment_type_list)) {
            self::$comment_type_list = DB::get_keyvalue('SELECT id, name FROM {commenttype} WHERE active = 1;');
        }
        self::$comment_type_list = Plugins::filter('list_comment_types', self::$comment_type_list);
        return self::$comment_type_list;
    }