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.

Class containing the data necessary for rendering the status field in the course participants page.

Copyright: 2017 Jun Pataleta
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 171 lines (6 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

status_field:: (3 methods):
  __construct()
  export_for_template()
  set_status()


Class: status_field  - X-Ref

Class containing the data for the status field.

__construct($enrolinstancename, $coursename, $fullname, $status, $timestart = null, $timeend = null,$enrolactions = [], $timeenrolled = null)   X-Ref
status_field constructor.

param: string $enrolinstancename The enrolment instance name.
param: string $coursename The course's full name.
param: string $fullname The user's full name.
param: string $status The user enrolment status.
param: int|null $timestart The timestamp when the user's enrolment starts.
param: int|null $timeend The timestamp when the user's enrolment ends.
param: user_enrolment_action[] $enrolactions Array of enrol action objects for the given enrolment method.
param: int|null $timeenrolled The timestamp when the user was enrolled.

export_for_template(renderer_base $output)   X-Ref
Function to export the renderer data in a format that is suitable for a
mustache template. This means:
1. No complex types - only stdClass, array, int, string, float, bool
2. Any additional info that is required for the template is pre-calculated (e.g. capability checks).

param: renderer_base $output Used to do a final render of any components that need to be rendered for export.
return: stdClass|array

set_status($status = self::STATUS_ACTIVE)   X-Ref
Status setter.

param: int $status The user enrolment status representing one of this class' STATUS_* constants.
return: status_field This class' instance. Useful for chaining.