Moodle PHP Documentation 4.4
Moodle 4.4.1 (Build: 20240610) (db07c09afc5)
|
Public Member Functions | |
add_members_to_room (array $userids, bool $queue=true) | |
Create a communication ad-hoc task for add members operation and add the user mapping. | |
configure_room_and_membership_by_provider (string $provider, stdClass $instance, string $communicationroomname, array $users, ?\stored_file $instanceimage=null, bool $queue=true,) | |
Configure the room and membership by provider selected for the communication instance. | |
create_and_configure_room (string $communicationroomname, ?\stored_file $avatar=null, ?\stdClass $instance=null, bool $queue=true,) | |
Create a communication ad-hoc task for create operation. | |
delete_room () | |
Create a communication ad-hoc task for delete operation. | |
form_definition (MoodleQuickForm $mform, string $selectdefaultcommunication=processor::PROVIDER_NONE) | |
Define the form elements for the communication api. | |
form_definition_for_provider (\MoodleQuickForm $mform, string $provider=processor::PROVIDER_NONE) | |
Set the form definitions for the plugins. | |
get_avatar () | |
Get the avatar file. | |
get_communication_room_url () | |
Get the communication room url. | |
get_form_provider () | |
Return the form provider. | |
get_processor () | |
Return the underlying communication processor object. | |
get_provider () | |
Get the communication provider. | |
get_room_name () | |
A helper to fetch the room name. | |
get_room_provider () | |
Return the room provider. | |
get_room_user_provider () | |
Return the room user provider. | |
get_user_provider () | |
Return the user provider. | |
reload () | |
Reload in the internal instance data. | |
remove_all_members_from_room (bool $queue=true) | |
Remove all users from the room. | |
remove_members_from_room (array $userids, bool $queue=true) | |
Create a communication ad-hoc task for remove members operation or action immediately. | |
set_avatar (?\stored_file $avatar) | |
Get the avatar file. | |
set_data (\stdClass $instance) | |
Set the form data if the data is already available. | |
show_communication_room_status_notification () | |
Display the communication room status notification. | |
sync_provider () | |
Add the task to sync the provider data with local Moodle data. | |
update_room (?int $active=null, ?string $communicationroomname=null, ?\stored_file $avatar=null, ?\stdClass $instance=null, bool $queue=true,) | |
Create a communication ad-hoc task for update operation. | |
update_room_membership (array $userids, bool $queue=true) | |
Create a communication ad-hoc task for updating members operation and update the user mapping. | |
Static Public Member Functions | |
static | get_communication_plugin_list_for_form () |
Get the list of plugins for form selection. | |
static | get_enabled_providers_and_default (string $selecteddefaulprovider=null) |
Get the enabled communication providers and default provider according to the selected provider. | |
static | is_available () |
Check if the communication api is enabled. | |
static | load_by_instance (context $context, string $component, string $instancetype, int $instanceid, ?string $provider=null,) |
Get the communication processor object. | |
Protected Member Functions | |
get_avatar_filerecord (string $filename) | |
Get the avatar file record for the avatar for filesystem. | |
core_communication\api::add_members_to_room | ( | array | $userids, |
bool | $queue = true ) |
Create a communication ad-hoc task for add members operation and add the user mapping.
This method will add a task to the queue to add the room users.
array | $userids | The user ids to add to the room |
bool | $queue | Whether to queue the task or not |
core_communication\api::configure_room_and_membership_by_provider | ( | string | $provider, |
stdClass | $instance, | ||
string | $communicationroomname, | ||
array | $users, | ||
?\stored_file | $instanceimage = null, | ||
bool | $queue = true ) |
Configure the room and membership by provider selected for the communication instance.
This method will add a task to the queue to configure the room and membership by comparing the change of provider. There are some major cases to consider for this method to allow minimum duplication when this api is used. Some of the major cases are:
string | $provider | The provider name |
stdClass | $instance | The instance object |
string | $communicationroomname | The communication room name |
array | $users | The user ids to add to the room |
null | stored_file | $instanceimage | The stored file for the avatar |
bool | $queue | Queue the task for the provider room or not |
core_communication\api::create_and_configure_room | ( | string | $communicationroomname, |
?\stored_file | $avatar = null, | ||
?\stdClass | $instance = null, | ||
bool | $queue = true ) |
Create a communication ad-hoc task for create operation.
This method will add a task to the queue to create the room.
string | $communicationroomname | The communication room name |
null | stored_file | $avatar | The stored file for the avatar |
stdClass | null | $instance | The actual instance object |
bool | $queue | Whether to queue the task or not |
core_communication\api::delete_room | ( | ) |
Create a communication ad-hoc task for delete operation.
This method will add a task to the queue to delete the room.
core_communication\api::form_definition | ( | MoodleQuickForm | $mform, |
string | $selectdefaultcommunication = processor::PROVIDER_NONE ) |
Define the form elements for the communication api.
This method will be called from the form definition method of the instance.
MoodleQuickForm | $mform | The form element |
string | $selectdefaultcommunication | The default selected communication provider in the form field |
core_communication\api::form_definition_for_provider | ( | \MoodleQuickForm | $mform, |
string | $provider = processor::PROVIDER_NONE ) |
Set the form definitions for the plugins.
MoodleQuickForm | $mform | The moodle form |
string | $provider | The provider name |
core_communication\api::get_avatar | ( | ) |
Get the avatar file.
null|stored_file |
|
protected |
Get the avatar file record for the avatar for filesystem.
string | $filename | The filename of the avatar |
stdClass |
|
static |
Get the list of plugins for form selection.
array |
core_communication\api::get_communication_room_url | ( | ) |
Get the communication room url.
string|null |
|
static |
Get the enabled communication providers and default provider according to the selected provider.
string | null | $selecteddefaulprovider |
array |
core_communication\api::get_form_provider | ( | ) |
Return the form provider.
core_communication\form_provider |
core_communication\api::get_processor | ( | ) |
Return the underlying communication processor object.
?processor |
core_communication\api::get_provider | ( | ) |
Get the communication provider.
string |
core_communication\api::get_room_name | ( | ) |
A helper to fetch the room name.
string |
core_communication\api::get_room_provider | ( | ) |
Return the room provider.
core_communication\room_chat_provider |
core_communication\api::get_room_user_provider | ( | ) |
Return the room user provider.
core_communication\room_user_provider |
core_communication\api::get_user_provider | ( | ) |
Return the user provider.
core_communication\user_provider |
|
static |
Get the communication processor object.
context | $context | The context of the item for the instance |
string | $component | The component of the item for the instance |
string | $instancetype | The type of the item for the instance |
int | $instanceid | The id of the instance |
string | null | $provider | The provider type - if null will load for this context's active provider. |
api |
core_communication\api::remove_all_members_from_room | ( | bool | $queue = true | ) |
Remove all users from the room.
bool | $queue | Whether to queue the task or not |
core_communication\api::remove_members_from_room | ( | array | $userids, |
bool | $queue = true ) |
Create a communication ad-hoc task for remove members operation or action immediately.
This method will add a task to the queue to remove the room users.
array | $userids | The user ids to remove from the room |
bool | $queue | Whether to queue the task or not |
core_communication\api::set_avatar | ( | ?\stored_file | $avatar | ) |
Get the avatar file.
If null is set, then delete the old area file and set the avatarfilename to null. This will make sure the plugin api deletes the avatar from the room.
null | stored_file | $avatar | The stored file for the avatar |
bool |
core_communication\api::set_data | ( | \stdClass | $instance | ) |
Set the form data if the data is already available.
stdClass | $instance | The instance object |
core_communication\api::update_room | ( | ?int | $active = null, |
?string | $communicationroomname = null, | ||
?\stored_file | $avatar = null, | ||
?\stdClass | $instance = null, | ||
bool | $queue = true ) |
Create a communication ad-hoc task for update operation.
This method will add a task to the queue to update the room.
null | int | $active | The selected active state of the provider |
null | string | $communicationroomname | The communication room name |
null | stored_file | $avatar | The stored file for the avatar |
stdClass | null | $instance | The actual instance object |
bool | $queue | Whether to queue the task or not |
core_communication\api::update_room_membership | ( | array | $userids, |
bool | $queue = true ) |
Create a communication ad-hoc task for updating members operation and update the user mapping.
This method will add a task to the queue to update the room users.
array | $userids | The user ids to add to the room |
bool | $queue | Whether to queue the task or not |