Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

Differences Between: [Versions 310 and 311] [Versions 39 and 311]

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: 413 lines (14 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: course_competency  - X-Ref

Class for loading/storing course_competencies from the DB.

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

return: array

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

return: void

get_courses_with_competency_and_user($competencyid, $userid)   X-Ref
Return the courses where both competency and user are.

A user is considered being in a course when they are enrolled, the enrolment is valid,
the enrolment instance is enabled, and the enrolment plugin is enabled..

param: int $competencyid The competency ID.
param: int $userid The user ID.
return: array Indexed by course ID.

get_ruleoutcome_list()   X-Ref
Return a list of rules.

return: array Indexed by outcome value.

get_ruleoutcome_name($ruleoutcome)   X-Ref
Human readable rule name.

param: int $ruleoutcome The value of ruleoutcome.
return: lang_string

validate_courseid($data)   X-Ref
Validate course ID.

param: int $data The course ID.
return: true|lang_string

validate_competencyid($data)   X-Ref
Validate competency ID.

param: int $data The competency ID.
return: true|lang_string

list_courses_min($competencyid)   X-Ref
Return the course IDs and visible flags that include this competency.

Only the ids and visible flag are returned, for the full records use list_courses.

param: int $competencyid The competency id
return: array containing courseid and visible.

list_courses($competencyid)   X-Ref
Return partial course records foreach course that contains this competency.

param: int $competencyid The competency id
return: array[stdClass] Array of course records containg id, visible, shortname, idnumber, fullname

count_competencies($courseid)   X-Ref
Count the competencies in this course.

param: int $courseid The course id
return: int

list_competencies($courseid)   X-Ref
List the competencies in this course.

param: int $courseid The course id
return: competency[] Indexed by competency ID.

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

param: int $courseid The course id
param: int $competencyid The competency id
return: competency

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

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

get_course_competency($courseid, $competencyid)   X-Ref
Get the specified course_competency in this course.

param: int $courseid The course id
param: int $competencyid The competency id
return: course_competency

list_course_competencies($courseid)   X-Ref
List the course_competencies in this course.

param: int $courseid The course id
return: course_competency[]

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

param: array $competencyids Array of competencies ids.
return: boolean Return true if one or more than a competency was found in a course.