Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

Differences Between: [Versions 311 and 402] [Versions 311 and 403]

Entity model representing template settings for the seb plugin.

Author: Nicholas Hoobin <nicholashoobin@catalyst-au.net>
Author: Dmitrii Metelkin <dmitriim@catalyst-au.net>
Copyright: 2020 Catalyst IT
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 135 lines (4 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

template:: (6 methods):
  define_properties()
  before_update()
  before_create()
  before_save()
  validate_content()
  can_delete()


Class: template  - X-Ref

Entity model representing template settings for the seb plugin.

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

return: array

before_update()   X-Ref
Hook to execute before an update.

Please note that at this stage the data has already been validated and therefore
any new data being set will not be validated before it is sent to the database.

before_create()   X-Ref
Hook to execute before a create.

Please note that at this stage the data has already been validated and therefore
any new data being set will not be validated before it is sent to the database.

before_save()   X-Ref
As there is no hook for before both create and update, this function is called by both hooks.


validate_content(string $content)   X-Ref
Validate template content.

param: string $content Content string to validate.
return: bool|\lang_string

can_delete()   X-Ref
Check if we can delete the template.

return: bool