Data registry business logic methods.
More...
Data registry business logic methods.
Mostly internal stuff.
- Copyright
- 2018 David Monllao
- License
- http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
◆ defaults_set()
static tool_dataprivacy\data_registry::defaults_set |
( |
| ) |
|
|
static |
Are data registry defaults set?
At least the system defaults need to be set.
- Return values
-
◆ get_defaults()
static tool_dataprivacy\data_registry::get_defaults |
( |
| $contextlevel, |
|
|
| $pluginname = '' ) |
|
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.
- Parameters
-
int | $contextlevel | The context level. |
string | $pluginname | The name of the plugin associated with the context level. |
- Return values
-
◆ get_effective_context_value()
static tool_dataprivacy\data_registry::get_effective_context_value |
( |
\context | $context, |
|
|
| $element, |
|
|
| $forcedvalue = false ) |
|
static |
Returns the effective value given a context instance.
- Parameters
-
context | $context | |
string | $element | 'category' or 'purpose' |
int | false | $forcedvalue | Use this value as if this was this context instance value. |
- Return values
-
persistent|false | It return a 'purpose' instance or a 'category' instance, depending on $element |
◆ get_effective_contextlevel_value()
static tool_dataprivacy\data_registry::get_effective_contextlevel_value |
( |
| $contextlevel, |
|
|
| $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.
- Parameters
-
int | $contextlevel | |
string | $element | 'category' or 'purpose' |
- Return values
-
tool_dataprivacy\purpose|false | |
◆ get_effective_default_contextlevel_purpose_and_category()
static tool_dataprivacy\data_registry::get_effective_default_contextlevel_purpose_and_category |
( |
| $contextlevel, |
|
|
| $forcedpurposevalue = false, |
|
|
| $forcedcategoryvalue = false, |
|
|
| $component = '' ) |
|
static |
Returns the effective default purpose and category for a context level.
- Parameters
-
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. |
- Return values
-
◆ get_site_categories()
static tool_dataprivacy\data_registry::get_site_categories |
( |
| ) |
|
|
static |
Returns all site categories that are visible to the current user.
- Return values
-
◆ get_subject_scope()
static tool_dataprivacy\data_registry::get_subject_scope |
( |
\context | $context | ) |
|
|
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.
- Parameters
-
- Return values
-
◆ var_names_from_context()
static tool_dataprivacy\data_registry::var_names_from_context |
( |
| $classname, |
|
|
| $pluginname = '' ) |
|
static |
Returns purpose and category var names from a context class name.
- Parameters
-
string | $classname | The context level's class. |
string | $pluginname | The name of the plugin associated with the context level. |
- Return values
-
The documentation for this class was generated from the following file:
- admin/tool/dataprivacy/classes/data_registry.php