Moodle PHP Documentation 4.4
Moodle 4.4.1 (Build: 20240610) (db07c09afc5)
core_communication\hook_listener Class Reference

Static Public Member Functions

static add_communication_membership_for_enrolled_user (after_user_enrolled $hook,)
 Add communication instance membership for an enrolled user.
 
static add_members_to_group_room (after_group_membership_added $hook,)
 Add members to group room when a new member is added to the group.
 
static create_course_communication (after_course_created $hook,)
 Create course communication instance.
 
static create_group_communication (after_group_created $hook,)
 Communication api call to create room for a group if course has group mode enabled.
 
static delete_course_communication (before_course_deleted $hook,)
 Delete course communication data and remove members.
 
static delete_group_communication (after_group_deleted $hook)
 Delete the communication room for a group if course has group mode enabled.
 
static delete_user_room_memberships (before_user_deleted $hook,)
 Delete all room memberships for a user.
 
static remove_communication_membership_for_unenrolled_user (before_user_enrolment_removed $hook,)
 Remove communication instance membership for an enrolled user.
 
static remove_communication_memberships_for_enrol_instance_deletion (before_enrol_instance_deleted $hook,)
 Remove the communication instance memberships when an enrolment instance is deleted.
 
static remove_members_from_group_room (after_group_membership_removed $hook,)
 Remove members from the room when a member is removed from group room.
 
static update_communication_membership_for_updated_user_enrolment (before_user_enrolment_updated $hook,)
 Update the communication instance membership for the user enrolment updates.
 
static update_communication_memberships_for_enrol_status_change (after_enrol_instance_status_updated $hook,)
 Update the communication memberships for enrol status change.
 
static update_course_communication (after_course_updated $hook,)
 Update the course communication instance.
 
static update_group_communication (after_group_updated $hook,)
 Communication api call to update room for a group if course has group mode enabled.
 
static update_user_membership_for_role_changes (after_role_assigned|after_role_unassigned $hook,)
 Update the room membership of the user for role assigned in a course.
 
static update_user_room_memberships (before_user_updated $hook,)
 Update the room membership for the user updates.
 

Static Protected Member Functions

static get_group_and_course_data_for_group_hook (mixed $hook)
 Get the course and group object for the group hook.
 

Member Function Documentation

◆ add_communication_membership_for_enrolled_user()

static core_communication\hook_listener::add_communication_membership_for_enrolled_user ( after_user_enrolled $hook)
static

Add communication instance membership for an enrolled user.

Parameters
after_user_enrolled$hookThe user enrolled hook.

◆ add_members_to_group_room()

static core_communication\hook_listener::add_members_to_group_room ( after_group_membership_added $hook)
static

Add members to group room when a new member is added to the group.

Parameters
after_group_membership_added$hookThe group membership added hook.

◆ create_course_communication()

static core_communication\hook_listener::create_course_communication ( after_course_created $hook)
static

Create course communication instance.

Parameters
after_course_created$hookThe course created hook.

◆ create_group_communication()

static core_communication\hook_listener::create_group_communication ( after_group_created $hook)
static

Communication api call to create room for a group if course has group mode enabled.

Parameters
after_group_created$hookThe group created hook.

◆ delete_course_communication()

static core_communication\hook_listener::delete_course_communication ( before_course_deleted $hook)
static

Delete course communication data and remove members.

Course can have communication data if it is a group or a course. This action is important to perform even if the experimental feature is disabled.

Parameters
before_course_deleted$hookThe course deleted hook.

◆ delete_group_communication()

static core_communication\hook_listener::delete_group_communication ( after_group_deleted $hook)
static

Delete the communication room for a group if course has group mode enabled.

Parameters
after_group_deleted$hookThe group deleted hook.

◆ delete_user_room_memberships()

static core_communication\hook_listener::delete_user_room_memberships ( before_user_deleted $hook)
static

Delete all room memberships for a user.

Parameters
before_user_deleted$hookThe user deleted hook.

◆ get_group_and_course_data_for_group_hook()

static core_communication\hook_listener::get_group_and_course_data_for_group_hook ( mixed $hook)
staticprotected

Get the course and group object for the group hook.

Parameters
mixed$hookThe hook object.
Return values
array

◆ remove_communication_membership_for_unenrolled_user()

static core_communication\hook_listener::remove_communication_membership_for_unenrolled_user ( before_user_enrolment_removed $hook)
static

Remove communication instance membership for an enrolled user.

Parameters
before_user_enrolment_removed$hookThe user unenrolled hook.

◆ remove_communication_memberships_for_enrol_instance_deletion()

static core_communication\hook_listener::remove_communication_memberships_for_enrol_instance_deletion ( before_enrol_instance_deleted $hook)
static

Remove the communication instance memberships when an enrolment instance is deleted.

Parameters
before_enrol_instance_deleted$hookThe enrol instance deleted hook.

◆ remove_members_from_group_room()

static core_communication\hook_listener::remove_members_from_group_room ( after_group_membership_removed $hook)
static

Remove members from the room when a member is removed from group room.

Parameters
after_group_membership_removed$hookThe group membership removed hook.

◆ update_communication_membership_for_updated_user_enrolment()

static core_communication\hook_listener::update_communication_membership_for_updated_user_enrolment ( before_user_enrolment_updated $hook)
static

Update the communication instance membership for the user enrolment updates.

Parameters
before_user_enrolment_updated$hookThe user enrolment updated hook.

◆ update_communication_memberships_for_enrol_status_change()

static core_communication\hook_listener::update_communication_memberships_for_enrol_status_change ( after_enrol_instance_status_updated $hook)
static

Update the communication memberships for enrol status change.

Parameters
after_enrol_instance_status_updated$hookThe enrol status updated hook.

◆ update_course_communication()

static core_communication\hook_listener::update_course_communication ( after_course_updated $hook)
static

Update the course communication instance.

Parameters
after_course_updated$hookThe course updated hook.

◆ update_group_communication()

static core_communication\hook_listener::update_group_communication ( after_group_updated $hook)
static

Communication api call to update room for a group if course has group mode enabled.

Parameters
after_group_updated$hookThe group updated hook.

◆ update_user_membership_for_role_changes()

static core_communication\hook_listener::update_user_membership_for_role_changes ( after_role_assigned|after_role_unassigned $hook)
static

Update the room membership of the user for role assigned in a course.

Parameters
after_role_assigned | after_role_unassigned$hook

◆ update_user_room_memberships()

static core_communication\hook_listener::update_user_room_memberships ( before_user_updated $hook)
static

Update the room membership for the user updates.

Parameters
before_user_updated$hookThe user updated hook.

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