public static function sort(array $records, array $fields) {
        $records = new coursecat_sortable_records($records);
        $records->sortfields = $fields;
        $records->uasort(array($records, 'sort_by_many_fields'));
        return $records->getArrayCopy();
    }
public static function sort(array $records, array $fields) {
        $records = new coursecat_sortable_records($records);
        $records->sortfields = $fields;
        $records->uasort(array($records, 'sort_by_many_fields'));
        return $records->getArrayCopy();
    }
public static function sort ( array $ records , array $ fields ) { $ records = new coursecat_sortable_records ( $ records ) ; $ records -> sortfields = $ fields ; $ records -> uasort ( array ( $ records , 'sort_by_many_fields' ) ) ; return $ records -> getArrayCopy ( ) ; }
Sorts this array using the given fields.

@param array $records
@param array $fields
@return array
Sorts this array using the given fields .