Moodle APIs  3.8
Moodle 3.8.6 (Build: 20201109)
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
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. More...
 
 matches (user_competency $usercompetency)
 Whether or not the rule is matched. More...
 
 validate_config ($value)
 Validate the rule config. More...
 

Static Public Member Functions

static get_name ()
 The name of the rule. More...
 
static migrate_config ($config, $mappings)
 Migrate rule config from one set of competencies to another. More...
 

Protected Member Functions

 get_config ()
 Get the rule config. More...
 

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_points, and core_competency\competency_rule_all.

◆ 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_points, and core_competency\competency_rule_all.

◆ 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_points, and core_competency\competency_rule_all.


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