Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.10.x will end 8 November 2021 (12 months).
  • Bug fixes for security issues in 3.10.x will end 9 May 2022 (18 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.

Differences Between: [Versions 310 and 402] [Versions 310 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