Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.0.x will end 8 May 2023 (12 months).
  • Bug fixes for security issues in 4.0.x will end 13 November 2023 (18 months).
  • PHP version: minimum PHP 7.3.0 Note: the minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is also supported.

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

(no description)

File Size: 147 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

return: bool
param: bool $columnsortable

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

return: string
param: string[] $sqlfields

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

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

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

return: mixed
param: mixed $value
param: array $values
param: array $callbacks Array of column callbacks, {@see column::add_callback} for definition