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.

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