Moodle PHP Documentation 4.5
Moodle 4.5dev (Build: 20240606) (d3ae1391abe)
core_reportbuilder\local\aggregation\base Class Reference
Inheritance diagram for core_reportbuilder\local\aggregation\base:
core\reportbuilder\local\entities\context core_badges\reportbuilder\local\entities\badge core_badges\reportbuilder\local\entities\badge_issued core_blog\reportbuilder\local\entities\blog core_comment\reportbuilder\local\entities\comment core_enrol\reportbuilder\local\entities\enrol core_files\reportbuilder\local\entities\file core_group\reportbuilder\local\entities\group core_group\reportbuilder\local\entities\group_member core_group\reportbuilder\local\entities\grouping core_notes\reportbuilder\local\entities\note core_reportbuilder\local\aggregation\avg core_reportbuilder\local\aggregation\count core_reportbuilder\local\aggregation\countdistinct core_reportbuilder\local\aggregation\groupconcat core_reportbuilder\local\aggregation\max core_reportbuilder\local\aggregation\min core_reportbuilder\local\aggregation\percent core_reportbuilder\local\aggregation\sum core_role\reportbuilder\local\entities\role core_role\reportbuilder\local\entities\role_assignment core_tag\reportbuilder\local\entities\collection core_tag\reportbuilder\local\entities\instance core_tag\reportbuilder\local\entities\tag

Static Public Member Functions

static compatible (int $columntype)
 Whether the aggregation is compatible with the given column type.
 
static format_value ($value, array $values, array $callbacks, int $columntype)
 Return formatted value for column when applying aggregation, by default executing all callbacks on the value.
 
static get_class_name ()
 Return the class name of the aggregation type.
 
static get_column_field_sql (array $sqlfields)
 Return SQL suitable for using within {.
 
static get_field_sql (string $field, int $columntype)
 Return the aggregated field SQL.
 
static get_name ()
 Return the display name of the aggregation.
 
static sortable (bool $columnsortable)
 Whether the aggregation is sortable, by default return the sortable status of the column itself.
 

Static Protected Member Functions

static get_column_fields_concat (array $sqlfields, string $delimeter=',', string $coalescechar=' ')
 Helper method for concatenating given fields for a column, so they are suitable for aggregation.
 

Member Function Documentation

◆ compatible()

static core_reportbuilder\local\aggregation\base::compatible ( int $columntype)
staticabstract

◆ format_value()

static core_reportbuilder\local\aggregation\base::format_value ( $value,
array $values,
array $callbacks,
int $columntype )
static

Return formatted value for column when applying aggregation, by default executing all callbacks on the value.

Should be overridden in child classes that need to format the column value differently (e.g. 'sum' would just show a numeric count value)

Parameters
mixed$value
array$values
array$callbacksArray of column callbacks, {
See also
column\add_callback} for definition
Parameters
int$columntypeThe original type of the column, to ensure it is preserved for callbacks
Return values
mixed

Reimplemented in core_reportbuilder\local\aggregation\avg, core_reportbuilder\local\aggregation\count, core_reportbuilder\local\aggregation\countdistinct, core_reportbuilder\local\aggregation\groupconcat, core_reportbuilder\local\aggregation\percent, and core_reportbuilder\local\aggregation\sum.

◆ get_class_name()

static core_reportbuilder\local\aggregation\base::get_class_name ( )
staticfinal

Return the class name of the aggregation type.

Return values
string

◆ get_column_field_sql()

static core_reportbuilder\local\aggregation\base::get_column_field_sql ( array $sqlfields)
static

Return SQL suitable for using within {.

See also
get_field_sql} for column fields, by default just the first one
Parameters
string[]$sqlfields
Return values
string

Reimplemented in core_reportbuilder\local\aggregation\countdistinct, and core_reportbuilder\local\aggregation\groupconcat.

◆ get_column_fields_concat()

static core_reportbuilder\local\aggregation\base::get_column_fields_concat ( array $sqlfields,
string $delimeter = ',',
string $coalescechar = ' ' )
staticfinalprotected

Helper method for concatenating given fields for a column, so they are suitable for aggregation.

Parameters
string[]$sqlfields
string$delimeter
string$coalescechar
Return values
string

◆ get_field_sql()

◆ get_name()

◆ sortable()

static core_reportbuilder\local\aggregation\base::sortable ( bool $columnsortable)
static

Whether the aggregation is sortable, by default return the sortable status of the column itself.

Parameters
bool$columnsortable
Return values
bool

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