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.

Class for loading/storing competencies from the DB.

Copyright: 2015 Damyon Wiese
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 297 lines (9 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: template_competency  - X-Ref

Class for loading/storing template_competencies from the DB.

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

return: array

count_templates($competencyid, $onlyvisible)   X-Ref
Count the templates using a competency.

return: int
param: int $competencyid The competency id
param: bool $onlyvisible If true, only count visible templates using this competency.

list_templates($competencyid, $onlyvisible)   X-Ref
List the templates using a competency.

return: array[competency]
param: int $competencyid The competency id
param: bool $onlyvisible If true, only count visible templates using this competency.

count_competencies($templateid)   X-Ref
Count the competencies in a template.

return: int
param: int $templateid The template id

count_competencies_with_no_courses($templateid)   X-Ref
Count the competencies in a template with no links to courses.

return: int
param: int $templateid The template id

get_competency($templateid, $competencyid)   X-Ref
Get a single competency from the template (only if it is really in the template).

return: competency
param: int $templateid The template id
param: int $competencyid The competency id

list_competencies($templateid)   X-Ref
List the competencies in this template.

return: array[competency]
param: int $templateid The template id

delete_by_templateid($templateid)   X-Ref
Remove the competencies in this template.

return: boolen
param: int $templateid The template id

before_validate()   X-Ref
Hook to execute before validate.

return: void

validate_competencyid($value)   X-Ref
Validate competencyid.

return: true|lang_string
param: int $value ID.

validate_templateid($value)   X-Ref
Validate templateid.

return: true|lang_string
param: int $value ID.

after_delete($result)   X-Ref
Hook to execute after delete.

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

has_records_for_competencies($competencyids)   X-Ref
Check if template competency has records for competencies.

return: boolean Return true if competencies were found in template_competency.
param: array $competencyids Array of competencies ids.