Moodle APIs 3.9
Moodle 3.9.13+ (Build: 20220325)
|
Data registry business logic methods. More...
Static Public Member Functions | |
static | defaults_set () |
Are data registry defaults set? More... | |
static | get_defaults ($contextlevel, $pluginname='') |
Returns the default purpose id and category id for the provided context level. More... | |
static | get_effective_context_value (\context $context, $element, $forcedvalue=false) |
Returns the effective value given a context instance. More... | |
static | get_effective_contextlevel_value ($contextlevel, $element) |
Returns the effective value for a context level. More... | |
static | get_effective_default_contextlevel_purpose_and_category ($contextlevel, $forcedpurposevalue=false, $forcedcategoryvalue=false, $component='') |
Returns the effective default purpose and category for a context level. More... | |
static | get_site_categories () |
Returns all site categories that are visible to the current user. More... | |
static | get_subject_scope (\context $context) |
Returns the roles assigned to the provided level. More... | |
static | var_names_from_context ($classname, $pluginname='') |
Returns purpose and category var names from a context class name. More... | |
Data registry business logic methods.
Mostly internal stuff.
|
static |
Are data registry defaults set?
At least the system defaults need to be set.
bool |
|
static |
Returns the default purpose id and category id for the provided context level.
The caller code is responsible of checking that $contextlevel is an integer.
int | $contextlevel | The context level. |
string | $pluginname | The name of the plugin associated with the context level. |
int[]|false[] |
|
static |
Returns the effective value given a context instance.
context | $context | |
string | $element | 'category' or 'purpose' |
int | false | $forcedvalue | Use this value as if this was this context instance value. |
persistent|false | It return a 'purpose' instance or a 'category' instance, depending on $element |
|
static |
Returns the effective value for a context level.
Note that this is different from the effective default context level (see get_effective_default_contextlevel_purpose_and_category) as this is returning the value set in the data registry, not in the defaults page.
int | $contextlevel | |
string | $element | 'category' or 'purpose' |
tool_dataprivacy::purpose|false |
|
static |
Returns the effective default purpose and category for a context level.
int | $contextlevel | |
int | bool | $forcedpurposevalue | Use this value as if this was this context level purpose. |
int | bool | $forcedcategoryvalue | Use this value as if this was this context level category. |
string | $component | The name of the component to check. |
int[] |
|
static |
Returns all site categories that are visible to the current user.
core_course_category[] |
|
static |
Returns the roles assigned to the provided level.
Important to note that it returns course-level assigned roles if the provided context level is below course.
context | $context |
array |
|
static |
Returns purpose and category var names from a context class name.
string | $classname | The context level's class. |
string | $pluginname | The name of the plugin associated with the context level. |
string[] |