Moodle APIs 4.3
Moodle 4.3.6 (Build: 20240812)
|
Class processor to manage the base operations of the providers. More...
Public Member Functions | |
add_delete_user_flag (array $userids) | |
Delete users flag for the instance users. | |
create_instance_user_mapping (array $userids) | |
Create communication user record for mapping and sync. | |
delete_instance () | |
Delete communication data. | |
delete_instance_non_synced_user_mapping (array $userids) | |
Delete communication user record for userid who are not synced. | |
delete_instance_user_mapping (array $userids) | |
Delete communication user record for userid. | |
delete_user_mappings_for_instance () | |
Delete communication user record for instance. | |
get_all_delete_flagged_userids () | |
Get all the user ids flagged as deleted. | |
get_all_userids_for_instance () | |
Get existing instance user ids. | |
get_avatar () | |
Get communication instance id. | |
get_avatar_filename () | |
Get the avatar file name. | |
get_component () | |
Get communication instance component. | |
get_context () | |
Get the context of the communication instance. | |
get_context_id () | |
Get the context id of the communication instance. | |
get_form_provider () | |
Get communication instance for form feature. | |
get_id () | |
Get communication instance id after creating the instance in communication table. | |
get_instance_id () | |
Get communication instance id. | |
get_instance_type () | |
Get communication instance type. | |
get_instance_userids (bool $synced=false, bool $deleted=false) | |
Get non synced instance user ids for the instance. | |
get_provider () | |
Get communication provider type. | |
get_room_name () | |
Get room name. | |
get_room_provider () | |
Get communication instance id. | |
get_room_url () | |
Get a room url. | |
get_room_user_provider () | |
Get communication instance id. | |
get_user_provider () | |
Get communication instance id. | |
is_avatar_synced () | |
Check if the avatar has been synced with the provider. | |
is_instance_active () | |
Check if communication instance is active. | |
mark_users_as_not_deleted (array $userids) | |
Mark users as not deleted for the instance. | |
mark_users_as_synced (array $userids) | |
Mark users as synced for the instance. | |
require_api_enabled () | |
Check if communication api is enabled. | |
require_room_features () | |
Get communication instance id. | |
require_room_user_features () | |
Get communication instance id. | |
require_user_features () | |
Get communication instance id. | |
requires_form_features () | |
Check form feature available. | |
reset_users_sync_flag (array $userids) | |
Reset users sync flag for the instance. | |
set_avatar_filename (?string $filename) | |
Set the avatar file name. | |
set_avatar_synced_flag (bool $synced) | |
Indicate if the avatar has been synced with the provider. | |
supports_form_features () | |
Check support for form feature. | |
supports_room_features () | |
Get communication instance id. | |
supports_room_user_features () | |
Get communication instance id. | |
supports_user_features () | |
Get communication instance id. | |
update_instance (?string $active=null, ?string $roomname=null,) | |
Update the communication instance with any changes. | |
Static Public Member Functions | |
static | create_instance (context $context, string $provider, int $instanceid, string $component, string $instancetype, string $roomname,) |
Create communication instance. | |
static | is_provider_available (string $provider) |
Is the communication provider enabled and configured, or disabled. | |
static | load_by_id (int $id) |
Load communication instance by id. | |
static | load_by_instance (context $context, string $component, string $instancetype, int $instanceid, ?string $provider=null,) |
Load communication instance by instance id. | |
static | set_provider_specific_form_definition (string $provider, MoodleQuickForm $mform) |
Set provider specific form definition. | |
Public Attributes | |
int const | PROVIDER_ACTIVE = 1 |
The provider active flag. | |
int const | PROVIDER_INACTIVE = 0 |
The provider inactive flag. | |
string const | PROVIDER_NONE = 'none' |
The magic 'none' provider. | |
Protected Member Functions | |
__construct (private stdClass $instancedata,) | |
Communication processor constructor. | |
Class processor to manage the base operations of the providers.
This class is responsible for creating, updating, deleting and loading the communication instance, associated actions.
|
protected |
Communication processor constructor.
stdClass | $instancedata | The instance data object |
core_communication\processor::add_delete_user_flag | ( | array | $userids | ) |
Delete users flag for the instance users.
array | $userids | The user ids |
|
static |
Create communication instance.
context | $context | The context of the item for the instance |
string | $provider | The communication provider |
int | $instanceid | The instance id |
string | $component | The component name |
string | $instancetype | The instance type |
string | $roomname | The room name |
processor|null |
core_communication\processor::create_instance_user_mapping | ( | array | $userids | ) |
Create communication user record for mapping and sync.
array | $userids | The user ids |
core_communication\processor::delete_instance_non_synced_user_mapping | ( | array | $userids | ) |
Delete communication user record for userid who are not synced.
array | $userids | The user ids |
core_communication\processor::delete_instance_user_mapping | ( | array | $userids | ) |
Delete communication user record for userid.
array | $userids | The user ids |
core_communication\processor::get_all_delete_flagged_userids | ( | ) |
Get all the user ids flagged as deleted.
array |
core_communication\processor::get_all_userids_for_instance | ( | ) |
Get existing instance user ids.
array |
core_communication\processor::get_avatar | ( | ) |
Get communication instance id.
bool|stored_file |
core_communication\processor::get_avatar_filename | ( | ) |
Get the avatar file name.
string|null |
core_communication\processor::get_component | ( | ) |
Get communication instance component.
string |
core_communication\processor::get_context | ( | ) |
Get the context of the communication instance.
context |
core_communication\processor::get_context_id | ( | ) |
Get the context id of the communication instance.
int |
core_communication\processor::get_form_provider | ( | ) |
Get communication instance for form feature.
form_provider |
core_communication\processor::get_id | ( | ) |
Get communication instance id after creating the instance in communication table.
int |
core_communication\processor::get_instance_id | ( | ) |
Get communication instance id.
int |
core_communication\processor::get_instance_type | ( | ) |
Get communication instance type.
string |
core_communication\processor::get_instance_userids | ( | bool | $synced = false, |
bool | $deleted = false ) |
Get non synced instance user ids for the instance.
bool | $synced | The synced status |
bool | $deleted | The deleted status |
array |
core_communication\processor::get_provider | ( | ) |
Get communication provider type.
string|null |
core_communication\processor::get_room_name | ( | ) |
Get room name.
string|null |
core_communication\processor::get_room_provider | ( | ) |
Get communication instance id.
room_chat_provider |
core_communication\processor::get_room_url | ( | ) |
Get a room url.
string|null |
core_communication\processor::get_room_user_provider | ( | ) |
Get communication instance id.
room_user_provider |
core_communication\processor::get_user_provider | ( | ) |
Get communication instance id.
user_provider |
core_communication\processor::is_avatar_synced | ( | ) |
Check if the avatar has been synced with the provider.
bool |
core_communication\processor::is_instance_active | ( | ) |
Check if communication instance is active.
bool |
|
static |
Is the communication provider enabled and configured, or disabled.
string | $provider | provider component name |
bool |
|
static |
Load communication instance by id.
int | $id | The communication instance id |
processor|null |
|
static |
Load communication instance by instance id.
context | $context | The context of the item for the instance |
string | $component | The component name |
string | $instancetype | The instance type |
int | $instanceid | The instance id |
string | null | $provider | The provider type - if null will load for this context's active provider. |
processor|null |
core_communication\processor::mark_users_as_not_deleted | ( | array | $userids | ) |
Mark users as not deleted for the instance.
array | $userids | The user ids |
core_communication\processor::mark_users_as_synced | ( | array | $userids | ) |
Mark users as synced for the instance.
array | $userids | The user ids |
core_communication\processor::requires_form_features | ( | ) |
Check form feature available.
bool |
core_communication\processor::reset_users_sync_flag | ( | array | $userids | ) |
Reset users sync flag for the instance.
array | $userids | The user ids |
core_communication\processor::set_avatar_filename | ( | ?string | $filename | ) |
Set the avatar file name.
string | null | $filename |
core_communication\processor::set_avatar_synced_flag | ( | bool | $synced | ) |
Indicate if the avatar has been synced with the provider.
boolean | $synced | True if avatar has been synced. |
|
static |
Set provider specific form definition.
string | $provider | The provider name |
MoodleQuickForm | $mform | The moodle form |
core_communication\processor::supports_form_features | ( | ) |
Check support for form feature.
bool |
core_communication\processor::supports_room_features | ( | ) |
Get communication instance id.
bool |
core_communication\processor::supports_room_user_features | ( | ) |
Get communication instance id.
bool |
core_communication\processor::supports_user_features | ( | ) |
Get communication instance id.
bool |
core_communication\processor::update_instance | ( | ?string | $active = null, |
?string | $roomname = null ) |
Update the communication instance with any changes.
null | int | $active | Active state of the instance (processor\PROVIDER_ACTIVE or processor\PROVIDER_INACTIVE) |
null | string | $roomname | The room name |