Moodle PHP Documentation 4.5
Moodle 4.5dev (Build: 20240606) (d3ae1391abe)
|
Competency rule base abstract class. More...
Public Member Functions | |
__construct (competency $competency) | |
Constructor. | |
matches (user_competency $usercompetency) | |
Whether or not the rule is matched. | |
validate_config ($value) | |
Validate the rule config. | |
Static Public Member Functions | |
static | get_name () |
The name of the rule. | |
static | migrate_config ($config, $mappings) |
Migrate rule config from one set of competencies to another. | |
Protected Member Functions | |
get_config () | |
Get the rule config. | |
Protected Attributes | |
competency | $competency |
The competency. | |
Competency rule base abstract class.
Rules are attached to a competency and then tested against a user competency to determine whether or not it matches.
core_competency\competency_rule::__construct | ( | competency | $competency | ) |
Constructor.
competency | $competency | The competency. |
|
protected |
|
static |
The name of the rule.
lang_string |
Reimplemented in core_competency\competency_rule_all, and core_competency\competency_rule_points.
|
abstract |
Whether or not the rule is matched.
user_competency | $usercompetency | The user competency to test against. |
bool |
Reimplemented in core_competency\competency_rule_all, and core_competency\competency_rule_points.
|
static |
Migrate rule config from one set of competencies to another.
Exceptions should be thrown when the migration can not be performed.
string | $config | Original config rule of a competency. |
array | $mappings | Array that matches the original competency IDs with the new competencies objects. |
string | New configuration. |
Exception |
Reimplemented in core_competency\competency_rule_points.
|
abstract |
Validate the rule config.
string | $value | The value to validate. |
bool |
Reimplemented in core_competency\competency_rule_all, and core_competency\competency_rule_points.