Moodle PHP Documentation 4.5
Moodle 4.5dev (Build: 20240606) (d3ae1391abe)
core_communication\helper Class Reference

Static Public Member Functions

static format_group_room_name (string $baseroomname, string $groupname)
 Format a group communication room name with the following syntax: 'Group A (Course 1)'.
 
static get_course (int $courseid)
 Communication api call to create room for a group if course has group mode enabled.
 
static get_course_communication_status_notification (\stdClass $course)
 Get the course communication status notification for course.
 
static get_course_communication_url (stdClass $course)
 Get the course communication url according to course setup.
 
static get_enrolled_users_for_course (stdClass $course)
 Get the enrolled users for course.
 
static get_users_has_access_to_all_groups (array $userids, int $courseid)
 Get users with the capability to access all groups.
 
static is_group_mode_enabled_for_course (stdClass $course)
 Is group mode enabled for the course.
 
static load_by_course (int $courseid, context $context, ?string $provider=null,)
 Load the communication instance for course id.
 
static load_by_group (int $groupid, context $context)
 Load the communication instance for group id.
 
static update_course_communication_instance (stdClass $course, bool $changesincoursecat)
 Update course communication according to course data.
 
static update_course_communication_room_membership (stdClass $course, array $userids, string $memberaction,)
 Helper to update room membership according to action passed.
 
static update_group_communication_instances_for_course (stdClass $course, string $provider,)
 Update the group communication instances.
 

Member Function Documentation

◆ format_group_room_name()

static core_communication\helper::format_group_room_name ( string $baseroomname,
string $groupname )
static

Format a group communication room name with the following syntax: 'Group A (Course 1)'.

Parameters
string$baseroomnameThe base room name.
string$groupnameThe group name.

◆ get_course()

static core_communication\helper::get_course ( int $courseid)
static

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

Parameters
int$courseidThe course id.
Return values
stdClass

◆ get_course_communication_status_notification()

static core_communication\helper::get_course_communication_status_notification ( \stdClass $course)
static

Get the course communication status notification for course.

Parameters
stdClass$courseThe course object.

◆ get_course_communication_url()

static core_communication\helper::get_course_communication_url ( stdClass $course)
static

Get the course communication url according to course setup.

Parameters
stdClass$courseThe course object.
Return values
stringThe communication room url.

◆ get_enrolled_users_for_course()

static core_communication\helper::get_enrolled_users_for_course ( stdClass $course)
static

Get the enrolled users for course.

Parameters
stdClass$courseThe course object.
Return values
array

◆ get_users_has_access_to_all_groups()

static core_communication\helper::get_users_has_access_to_all_groups ( array $userids,
int $courseid )
static

Get users with the capability to access all groups.

Parameters
array$useridsuser ids to check the permission
int$courseidcourse id
Return values
arrayof userids

◆ is_group_mode_enabled_for_course()

static core_communication\helper::is_group_mode_enabled_for_course ( stdClass $course)
static

Is group mode enabled for the course.

Parameters
stdClass$courseThe course object

◆ load_by_course()

static core_communication\helper::load_by_course ( int $courseid,
context $context,
?string $provider = null )
static

Load the communication instance for course id.

Parameters
int$courseidThe course id
context$contextThe context
string | null$providerThe provider name
Return values
apiThe communication instance

◆ load_by_group()

static core_communication\helper::load_by_group ( int $groupid,
context $context )
static

Load the communication instance for group id.

Parameters
int$groupidThe group id
context$contextThe context, to make sure any instance using group can load the communication instance
Return values
apiThe communication instance.

◆ update_course_communication_instance()

static core_communication\helper::update_course_communication_instance ( stdClass $course,
bool $changesincoursecat )
static

Update course communication according to course data.

Course can have course or group rooms. Group mode enabling will create rooms for groups.

Parameters
stdClass$courseThe course data
bool$changesincoursecatWhether the course moved to a different category

◆ update_course_communication_room_membership()

static core_communication\helper::update_course_communication_room_membership ( stdClass $course,
array $userids,
string $memberaction )
static

Helper to update room membership according to action passed.

This method will help reduce a large amount of duplications of code in different places in core.

Parameters
stdClass$courseThe course object.
array$useridsThe user ids to add to the communication room.
string$memberactionThe action to perform on the communication room.

◆ update_group_communication_instances_for_course()

static core_communication\helper::update_group_communication_instances_for_course ( stdClass $course,
string $provider )
static

Update the group communication instances.

Parameters
stdClass$courseThe course object.
string$providerThe provider name.

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