Moodle APIs  3.8
Moodle 3.8.6 (Build: 20201109)
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
coursecat_sortable_records Class Reference

An array of records that is sortable by many fields. More...

Inheritance diagram for coursecat_sortable_records:

Public Member Functions

 sort_by_many_fields ($a, $b)
 Sorts the two records based upon many fields. More...
 

Static Public Member Functions

static sort (array $records, array $fields)
 Sorts this array using the given fields. More...
 

Protected Attributes

array $sortfields = array()
 An array of sortable fields. More...
 

Detailed Description

An array of records that is sortable by many fields.

For more info on the ArrayObject class have a look at php.net.

@subpackage course

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Member Function Documentation

◆ sort()

static coursecat_sortable_records::sort ( array  $records,
array  $fields 
)
static

Sorts this array using the given fields.

Parameters
array$records
array$fields
Return values
array

◆ sort_by_many_fields()

coursecat_sortable_records::sort_by_many_fields (   $a,
  $b 
)

Sorts the two records based upon many fields.

This method should not be called itself, please call $sort instead. It has been marked as access private as such.

Parameters
stdClass$a
stdClass$b
Return values
int

Member Data Documentation

◆ $sortfields

array coursecat_sortable_records::$sortfields = array()
protected

An array of sortable fields.

Gets set temporarily when sort is called.


The documentation for this class was generated from the following file: