private function get_role_name($rid) {
        global $DB, $PAGE;
        $rec = $DB->get_record('role', array('id' => $rid));

        if ($rec) {
            return role_get_name($rec, $PAGE->context, ROLENAME_ALIAS);
        } else {
            return null;
        }
    }
private function get_role_name($rid) {
        global $DB, $PAGE;
        $rec = $DB->get_record('role', array('id' => $rid));

        if ($rec) {
            return role_get_name($rec, $PAGE->context, ROLENAME_ALIAS);
        } else {
            return null;
        }
    }
private function get_role_name ( $ rid ) { global $ DB , $ PAGE ; $ rec = $ DB -> get_record ( 'role' , array ( 'id' => $ rid ) ) ; if ( $ rec ) { return role_get_name ( $ rec , $ PAGE -> context , ROLENAME_ALIAS ) ; } else { return null ; } }
Gets role name.
If no such role exists this function returns null.

@return string|null
Gets role name . If no such role exists this function returns null .