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 401 and 402] [Versions 401 and 403]

A check result class

Copyright: 2020 Brendan Heywood <brendan@catalyst-au.net>
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 192 lines (6 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

result:: (7 methods):
  get_ref()
  __construct()
  get_status()
  get_summary()
  get_details()
  export_for_template()
  get_template_name()


Class: result  - X-Ref

A check object returns a result object

Most checks can use this an instance of this directly but if you have a
'details' which is computationally expensive then extend this and overide
the get_details() method so that it is only called when it will be needed.

get_ref()   X-Ref
Get the check reference label

return: string must be globally unique

__construct($status, $summary, $details = '')   X-Ref
Constructor

param: int $status code
param: string $summary a 1 liner summary
param: string $details as a html chunk

get_status()   X-Ref
Get the check status

return: string one of the consts eg result::OK

get_summary()   X-Ref
Summary of the check

return: string formatted html

get_details()   X-Ref
Get the check detailed info

return: string formatted html

export_for_template(\renderer_base $output)   X-Ref
Export this data so it can be used as the context for a mustache template.

param: renderer_base $output typically, the renderer that's calling this function
return: stdClass data context for a mustache template

get_template_name()   X-Ref
Which mustache template?

return: string path to mustache template