Habari\ACL::all_tokens PHP Method

all_tokens() public static method

Get an array of QueryRecord objects containing all permission tokens
public static all_tokens ( string $order = 'id' ) : array
$order string the order in which to sort the returning array
return array an array of QueryRecord objects containing all tokens
    public static function all_tokens($order = 'id')
    {
        $order = strtolower($order);
        if ('id' != $order && 'name' != $order && 'description' != $order) {
            $order = 'id';
        }
        $tokens = DB::get_results('SELECT id, name, description, token_group, token_type FROM {tokens} ORDER BY ' . $order);
        return $tokens ? $tokens : array();
    }