Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

Differences Between: [Versions 400 and 401] [Versions 401 and 402] [Versions 401 and 403]

(no description)

File Size: 141 lines (5 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

base:: (5 methods):
  get_class_name()
  sortable()
  get_column_field_sql()
  get_column_fields_concat()
  format_value()


Class: base  - X-Ref

Base class for column aggregation types

get_class_name()   X-Ref
Return the class name of the aggregation type

return: string

sortable(bool $columnsortable)   X-Ref
Whether the aggregation is sortable, by default return the sortable status of the column itself

param: bool $columnsortable
return: bool

get_column_field_sql(array $sqlfields)   X-Ref
Return SQL suitable for using within {@see get_field_sql} for column fields, by default just the first one

param: string[] $sqlfields
return: string

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

param: string[] $sqlfields
param: string $delimeter
param: string $coalescechar
return: string

format_value($value, array $values, array $callbacks, int $columntype)   X-Ref
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)

param: mixed $value
param: array $values
param: array $callbacks Array of column callbacks, {@see column::add_callback} for definition
param: int $columntype The original type of the column, to ensure it is preserved for callbacks
return: mixed