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]

(no description)

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

Defines 1 class


Class: filter  - X-Ref

Persistent class to represent a report filter/condition

define_properties()   X-Ref
Return the definition of the properties of this model.

return: array

validate_reportid(int $reportid)   X-Ref
Validate reportid property

param: int $reportid
return: bool|lang_string

after_create()   X-Ref
Ensure report source is notified of new filter


after_update($result)   X-Ref
Ensure report source is notified of updated filter

param: bool $result

after_delete($result)   X-Ref
Ensure report source is notified of deleted filter

param: bool $result

get_report()   X-Ref
Return the report this filter belongs to

return: report

get_filter_record(int $reportid, int $filterid)   X-Ref
Return filter record

param: int $reportid
param: int $filterid
return: false|static

get_filter_records(int $reportid, string $sort = '', string $order = 'ASC')   X-Ref
Return filter records for report

param: int $reportid
param: string $sort
param: string $order
return: static[]

get_condition_record(int $reportid, int $conditionid)   X-Ref
Return condition record

param: int $reportid
param: int $conditionid
return: false|static

get_condition_records(int $reportid, string $sort = '', string $order = 'ASC')   X-Ref
Return condition records for report

param: int $reportid
param: string $sort
param: string $order
return: static[]

get_max_filterorder(int $reportid, bool $iscondition = false)   X-Ref
Helper method to return the current maximum filter order value for a report

param: int $reportid
param: bool $iscondition
return: int

get_formatted_heading(?context $context = null)   X-Ref
Return formatted filter heading

param: context|null $context If the context of the report is already known, it should be passed here
return: string