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.

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