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.

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

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

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

return: bool