|
static | get_providers_for_actions (array $actions, bool $enabledonly=false) |
| Given a list of actions get the provider plugins that support them.
|
|
static | get_supported_actions (string $pluginname) |
| Get the list of actions that this provider or placement supports, given the name of the plugin.
|
|
static | get_user_policy_status (int $userid) |
| Get the user policy.
|
|
static | is_action_available (string $actionclass) |
| Check if an action is available.
|
|
static | is_action_enabled (string $plugin, string $actionclass) |
| Check if an action is enabled for a given plugin.
|
|
static | set_action_state (string $plugin, string $actionbasename, int $enabled) |
| Set the action state for a given plugin.
|
|
static | user_policy_accepted (int $userid, int $contextid) |
| Set the policy acceptance for a given user.
|
|
◆ call_action_provider()
core_ai\manager::call_action_provider |
( |
provider | $provider, |
|
|
base | $action ) |
|
protected |
Call the action provider.
The named provider will process the action and return the result.
- Parameters
-
provider | $provider | The provider to call. |
base | $action | The action to process. |
- Return values
-
responses::response_base | The result of the action. |
◆ get_providers_for_actions()
static core_ai\manager::get_providers_for_actions |
( |
array | $actions, |
|
|
bool | $enabledonly = false ) |
|
static |
Given a list of actions get the provider plugins that support them.
Will return an array of arrays, indexed by action name.
- Parameters
-
array | $actions | An array of fully qualified action class names. |
bool | $enabledonly | If true, only return enabled providers. |
- Return values
-
array | An array of provider instances indexed by action name. |
◆ get_supported_actions()
static core_ai\manager::get_supported_actions |
( |
string | $pluginname | ) |
|
|
static |
Get the list of actions that this provider or placement supports, given the name of the plugin.
- Parameters
-
string | $pluginname | The name of the plugin to get the actions for. |
- Return values
-
array | An array of action class names. |
◆ get_user_policy_status()
static core_ai\manager::get_user_policy_status |
( |
int | $userid | ) |
|
|
static |
Get the user policy.
- Parameters
-
- Return values
-
bool | True if the policy was accepted, false otherwise. |
◆ is_action_available()
static core_ai\manager::is_action_available |
( |
string | $actionclass | ) |
|
|
static |
Check if an action is available.
Action is available if it is enabled for at least one enabled provider.
- Parameters
-
string | $actionclass | The fully qualified action class name to be checked. |
- Return values
-
◆ is_action_enabled()
static core_ai\manager::is_action_enabled |
( |
string | $plugin, |
|
|
string | $actionclass ) |
|
static |
Check if an action is enabled for a given plugin.
- Parameters
-
string | $plugin | The name of the plugin. |
string | $actionclass | The fully qualified action class name to be checked. |
- Return values
-
mixed | Returns the configuration value of the action for the given plugin. |
◆ process_action()
core_ai\manager::process_action |
( |
base | $action | ) |
|
Process an action.
This is the entry point for processing an action.
- Parameters
-
base | $action | The action to process. Action must be configured. |
- Return values
-
responses::response_base | The result of the action. |
◆ set_action_state()
static core_ai\manager::set_action_state |
( |
string | $plugin, |
|
|
string | $actionbasename, |
|
|
int | $enabled ) |
|
static |
Set the action state for a given plugin.
- Parameters
-
string | $plugin | The name of the plugin. |
string | $actionbasename | The action to be set. |
int | $enabled | The state to be set (e.g., enabled or disabled). |
- Return values
-
bool | Returns true if the configuration was successfully set, false otherwise. |
◆ user_policy_accepted()
static core_ai\manager::user_policy_accepted |
( |
int | $userid, |
|
|
int | $contextid ) |
|
static |
Set the policy acceptance for a given user.
- Parameters
-
int | $userid | The user id. |
int | $contextid | The context id the policy was accepted in. |
- Return values
-
bool | True if the policy was set, false otherwise. |
The documentation for this class was generated from the following file: