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.

Class for loading/storing learning plan templates from the DB.

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

Defines 1 class

template:: (11 methods):
  define_properties()
  after_update()
  before_validate()
  can_manage()
  can_manage_context()
  can_read()
  can_read_context()
  get_context()
  validate_contextid()
  validate_duedate()
  has_plans()


Class: template  - X-Ref

Class for loading/storing learning plan templates from the DB.

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

return: array

after_update($result)   X-Ref
Hook to execute after an update.

return: void
param: bool $result Whether or not the update was successful.

before_validate()   X-Ref
Hook to execute before validate.

return: void

can_manage()   X-Ref
Whether or not the current user can read the template.

return: bool

can_manage_context($context)   X-Ref
Whether or not the current user can manage the template.

return: bool
param: context $context

can_read()   X-Ref
Whether or not the current user can read the template.

return: bool

can_read_context($context)   X-Ref
Whether or not the current user can read the template.

return: bool
param: context $context

get_context()   X-Ref
Get the context.

return: context The context

validate_contextid($value)   X-Ref
Validate the context ID.

return: bool|lang_string
param: int $value The context ID.

validate_duedate($value)   X-Ref
Validate the due date.

The due date can always be changed, but when it is it must be:
- unset
- set in the future.

return: bool|lang_string
param: int $value The due date.

has_plans()   X-Ref
Returns true when the template has user learning plans.

return: boolean