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.

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.

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

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.

param: context $context
return: bool

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.

param: context $context
return: bool

get_context()   X-Ref
Get the context.

return: context The context

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

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

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.

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

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

return: boolean