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.

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.

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

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

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

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

param: int $templateid The template id
return: int

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

param: int $templateid The template id
return: int

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

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

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

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

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

param: int $templateid The template id
return: boolen

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

return: void

validate_competencyid($value)   X-Ref
Validate competencyid.

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

validate_templateid($value)   X-Ref
Validate templateid.

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

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

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

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

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