Moodle PHP Documentation 4.3
Moodle 4.3.5 (Build: 20240610) (7dcfaa79f78)
core_competency\competency_rule Class Reference

Competency rule base abstract class. More...

Inheritance diagram for core_competency\competency_rule:
core_competency\competency_rule_all core_competency\competency_rule_points

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.
 

Detailed Description

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.

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Constructor & Destructor Documentation

◆ __construct()

core_competency\competency_rule::__construct ( competency $competency)

Constructor.

Parameters
competency$competencyThe competency.

Member Function Documentation

◆ get_config()

core_competency\competency_rule::get_config ( )
protected

Get the rule config.

Return values
mixed

Reimplemented in core_competency\competency_rule_points.

◆ get_name()

static core_competency\competency_rule::get_name ( )
static

The name of the rule.

Return values
lang_string

Reimplemented in core_competency\competency_rule_all, and core_competency\competency_rule_points.

◆ matches()

core_competency\competency_rule::matches ( user_competency $usercompetency)
abstract

Whether or not the rule is matched.

Parameters
user_competency$usercompetencyThe user competency to test against.
Return values
bool

Reimplemented in core_competency\competency_rule_all, and core_competency\competency_rule_points.

◆ migrate_config()

static core_competency\competency_rule::migrate_config ( $config,
$mappings )
static

Migrate rule config from one set of competencies to another.

Exceptions should be thrown when the migration can not be performed.

Parameters
string$configOriginal config rule of a competency.
array$mappingsArray that matches the original competency IDs with the new competencies objects.
Return values
stringNew configuration.
Exceptions
Exception

Reimplemented in core_competency\competency_rule_points.

◆ validate_config()

core_competency\competency_rule::validate_config ( $value)
abstract

Validate the rule config.

Parameters
string$valueThe value to validate.
Return values
bool

Reimplemented in core_competency\competency_rule_all, and core_competency\competency_rule_points.


The documentation for this class was generated from the following file: