Rule manager class.
More...
Rule manager class.
- Copyright
- 2014 onwards Simey Lameze lamez.nosp@m.e@gm.nosp@m.ail.c.nosp@m.om
- License
- http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
◆ add_rule()
static tool_monitor\rule_manager::add_rule |
( |
|
$ruledata | ) |
|
|
static |
Create a new rule.
- Parameters
-
stdClass | $ruledata | data to insert as new rule entry. |
- Return values
-
rule | An instance of rule class. |
◆ clean_ruledata_form()
static tool_monitor\rule_manager::clean_ruledata_form |
( |
|
$mformdata | ) |
|
|
static |
Clean data submitted by mform.
- Parameters
-
stdClass | $mformdata | data to insert as new rule entry. |
- Return values
-
stdClass | Cleaned rule data. |
◆ count_rules_by_courseid()
static tool_monitor\rule_manager::count_rules_by_courseid |
( |
|
$courseid | ) |
|
|
static |
Get rule count by course id.
- Parameters
-
int | $courseid | course id of the rule. |
- Return values
-
int | count of rules present in system visible in the given course id. |
◆ delete_rule()
static tool_monitor\rule_manager::delete_rule |
( |
|
$ruleid, |
|
|
|
$coursecontext = null |
|
) |
| |
|
static |
Delete a rule and associated subscriptions, by rule id.
- Parameters
-
int | $ruleid | id of rule to be deleted. |
context | null | $coursecontext | the context of the course - this is passed when we can not get the context via context_course as the course has been deleted. |
- Return values
-
◆ get_instances()
static tool_monitor\rule_manager::get_instances |
( |
|
$arr | ) |
|
|
staticprotected |
Helper method to convert db records to instances.
- Parameters
-
- Return values
-
array | of rules as instances. |
◆ get_rule()
static tool_monitor\rule_manager::get_rule |
( |
|
$ruleorid | ) |
|
|
static |
Get an instance of rule class.
- Parameters
-
stdClass | int | $ruleorid | A rule object from database or rule id. |
- Return values
-
◆ get_rules_by_courseid()
static tool_monitor\rule_manager::get_rules_by_courseid |
( |
|
$courseid, |
|
|
|
$limitfrom = 0 , |
|
|
|
$limitto = 0 , |
|
|
|
$includesite = true |
|
) |
| |
|
static |
Get rules by course id.
- Parameters
-
int | $courseid | course id of the rule. |
int | $limitfrom | Limit from which to fetch rules. |
int | $limitto | Limit to which rules need to be fetched. |
bool | $includesite | Determines whether we return site wide rules or not. |
- Return values
-
array | List of rules for the given course id, if specified will also include site rules. |
◆ get_rules_by_event()
static tool_monitor\rule_manager::get_rules_by_event |
( |
|
$eventname | ) |
|
|
static |
Get rules by event name.
- Parameters
-
string | $eventname | event name of the rule. |
- Return values
-
array | List of rules for the given event. |
◆ get_rules_by_plugin()
static tool_monitor\rule_manager::get_rules_by_plugin |
( |
|
$plugin | ) |
|
|
static |
Get rules by plugin name.
- Parameters
-
string | $plugin | plugin name of the rule. |
- Return values
-
array | List of rules for the given plugin name. |
◆ update_rule()
static tool_monitor\rule_manager::update_rule |
( |
|
$ruledata | ) |
|
|
static |
Update rule data.
- Exceptions
-
- Parameters
-
object | $ruledata | rule data to be updated. |
- Return values
-
The documentation for this class was generated from the following file: