Moodle PHP Documentation 4.3
Moodle 4.3.5 (Build: 20240610) (7dcfaa79f78)
communication_matrix\communication_feature Class Reference
Inheritance diagram for communication_matrix\communication_feature:
core_communication\communication_provider core_communication\form_provider core_communication\room_chat_provider core_communication\room_user_provider core_communication\user_provider

Public Member Functions

 add_members_to_room (array $userids)
 Add members to a room.
 
 check_room_membership (string $matrixuserid)
 Check if a user is a member of a room.
 
 check_user_exists (string $matrixuserid)
 Check if a user exists in Matrix.
 
 create_chat_room ()
 Create a room based on the data in the communication instance.
 
 create_members (array $userids)
 Create members.
 
 delete_chat_room ()
 Delete a provider room when a instance is deleted.
 
 get_chat_room_url ()
 Generate a room url if there is a room.
 
 get_room_configuration ()
 Get the stored room configuration.
 
 get_room_id ()
 Return the current room id.
 
 get_user_allowed_power_level (int $userid)
 Get the allowed power level for the user id according to perms/site admin or default.
 
 reload ()
 Reload the room information.
 
 remove_members_from_room (array $userids)
 Remove members from a room.
 
 save_form_data (\stdClass $instance)
 Set the form data to the instance if any data is available.
 
 set_form_data (\stdClass $instance)
 Set the form data to the instance if any data is available.
 
 update_chat_room ()
 Update a provider room when a instance is updated.
 
 update_room_avatar ()
 Update the room avatar when an instance image is added or updated.
 
 update_room_membership (array $userids)
 Update room membership for the communication room.
 

Static Public Member Functions

static get_body (Response $response)
 Get the body of a response as a stdClass.
 
static is_configured ()
 Check if the provider is configured or not.
 
static load_for_instance (processor $communication)
 Load the communication provider for the communication api.
 
static set_form_definition (\MoodleQuickForm $mform)
 Set the form definitions.
 

Protected Member Functions

 remote_room_exists ()
 Whether the room exists on the remote server.
 
 room_exists ()
 Check whether the room configuration has been created yet.
 

Protected Attributes

string null string $homeserverurl = null
 The URI of the home server.
 
communication_matrix local spec v1p1 null matrix_client $matrixapi
 The Matrix API processor.
 
string string $webclienturl
 The URI of the Matrix web client.
 

Member Function Documentation

◆ add_members_to_room()

communication_matrix\communication_feature::add_members_to_room ( array $userids)

Add members to a room.

Parameters
array$useridsThe user ids to add

Implements core_communication\room_user_provider.

◆ check_room_membership()

communication_matrix\communication_feature::check_room_membership ( string $matrixuserid)

Check if a user is a member of a room.

Use if membership confirmation is needed before doing something else.

Parameters
string$matrixuseridThe Matrix user id to check
Return values
bool

◆ check_user_exists()

communication_matrix\communication_feature::check_user_exists ( string $matrixuserid)

Check if a user exists in Matrix.

Use if user existence is needed before doing something else.

Parameters
string$matrixuseridThe Matrix user id to check
Return values
bool

◆ create_chat_room()

communication_matrix\communication_feature::create_chat_room ( )

Create a room based on the data in the communication instance.

Return values
bool

Implements core_communication\room_chat_provider.

◆ create_members()

communication_matrix\communication_feature::create_members ( array $userids)

Create members.

Parameters
array$useridsThe Moodle user ids to create

Implements core_communication\user_provider.

◆ delete_chat_room()

communication_matrix\communication_feature::delete_chat_room ( )

Delete a provider room when a instance is deleted.

Implements core_communication\room_chat_provider.

◆ get_body()

static communication_matrix\communication_feature::get_body ( Response $response)
static

Get the body of a response as a stdClass.

Parameters
Response$response
Return values
stdClass

◆ get_chat_room_url()

communication_matrix\communication_feature::get_chat_room_url ( )

Generate a room url if there is a room.

Return values
string|null

Implements core_communication\room_chat_provider.

◆ get_room_configuration()

communication_matrix\communication_feature::get_room_configuration ( )

Get the stored room configuration.

Return values
null|matrix_room

◆ get_room_id()

communication_matrix\communication_feature::get_room_id ( )

Return the current room id.

Return values
string|null

◆ get_user_allowed_power_level()

communication_matrix\communication_feature::get_user_allowed_power_level ( int $userid)

Get the allowed power level for the user id according to perms/site admin or default.

Parameters
int$userid
Return values
int

◆ is_configured()

static communication_matrix\communication_feature::is_configured ( )
static

Check if the provider is configured or not.

This method is intended to check if the plugin have got any settings and if all the settings are set properly. This checking helps to reduce errors in future when a communication instance is added for the provider and not configured.

Implements core_communication\communication_provider.

◆ load_for_instance()

static communication_matrix\communication_feature::load_for_instance ( processor $communication)
static

Load the communication provider for the communication api.

Parameters
processor$communicationThe communication processor object
Return values
communication_featureThe communication provider object

Implements core_communication\communication_provider.

◆ reload()

communication_matrix\communication_feature::reload ( )

Reload the room information.

This may be necessary after a room has been created or updated via the adhoc task. This is primarily intended for use in unit testing, but may have real world cases too.

◆ remote_room_exists()

communication_matrix\communication_feature::remote_room_exists ( )
protected

Whether the room exists on the remote server.

This does not involve a remote call, but checks whether Moodle is aware of the room id.

Return values
bool

◆ remove_members_from_room()

communication_matrix\communication_feature::remove_members_from_room ( array $userids)

Remove members from a room.

Parameters
array$useridsThe Moodle user ids to remove

Implements core_communication\room_user_provider.

◆ room_exists()

communication_matrix\communication_feature::room_exists ( )
protected

Check whether the room configuration has been created yet.

Return values
bool

◆ save_form_data()

communication_matrix\communication_feature::save_form_data ( \stdClass $instance)

Set the form data to the instance if any data is available.

Parameters
stdClass$instanceThe actual instance to set the data

Implements core_communication\form_provider.

◆ set_form_data()

communication_matrix\communication_feature::set_form_data ( \stdClass $instance)

Set the form data to the instance if any data is available.

Parameters
stdClass$instanceThe actual instance to set the data

Implements core_communication\form_provider.

◆ set_form_definition()

static communication_matrix\communication_feature::set_form_definition ( \MoodleQuickForm $mform)
static

Set the form definitions.

Parameters
MoodleQuickForm$mformThe form object

Implements core_communication\form_provider.

◆ update_chat_room()

communication_matrix\communication_feature::update_chat_room ( )

Update a provider room when a instance is updated.

Implements core_communication\room_chat_provider.

◆ update_room_membership()

communication_matrix\communication_feature::update_room_membership ( array $userids)

Update room membership for the communication room.

Parameters
array$useridsThe user ids to be updated

Implements core_communication\room_user_provider.


The documentation for this class was generated from the following file: