Moodle APIs  3.8
Moodle 3.8.6 (Build: 20201109)
Static Public Member Functions | Static Protected Member Functions | List of all members
core_message_external Class Reference
Inheritance diagram for core_message_external:
external_api

Static Public Member Functions

static block_contacts ($userids, $userid=0)
 Block contacts. More...
 
static block_contacts_is_deprecated ()
 Marking the method as deprecated. More...
 
static block_contacts_parameters ()
 Block contacts parameters description. More...
 
static block_contacts_returns ()
 Block contacts return description. More...
 
static block_user (int $userid, int $blockeduserid)
 Blocks a user. More...
 
static block_user_parameters ()
 Block user parameters description. More...
 
static block_user_returns ()
 Block user return description. More...
 
static call_external_function ($function, $args, $ajaxonly=false)
 Call an external function validating all params/returns correctly. More...
 
static clean_returnvalue (external_description $description, $response)
 Clean response If a response attribute is unknown from the description, we just ignore the attribute. More...
 
static confirm_contact_request (int $userid, int $requesteduserid)
 Confirm a contact request. More...
 
static confirm_contact_request_parameters ()
 Confirm a contact request parameters description. More...
 
static confirm_contact_request_returns ()
 Confirm a contact request return description. More...
 
static create_contact_request (int $userid, int $requesteduserid)
 Creates a contact request. More...
 
static create_contact_request_parameters ()
 Creates a contact request parameters description. More...
 
static create_contact_request_returns ()
 Creates a contact request return description. More...
 
static create_contacts ($userids, $userid=0)
 Create contacts. More...
 
static create_contacts_is_deprecated ()
 Marking the method as deprecated. More...
 
static create_contacts_parameters ()
 Create contacts parameters description. More...
 
static create_contacts_returns ()
 Create contacts return description. More...
 
static data_for_messagearea_contacts ($userid, $limitfrom=0, $limitnum=0)
 Get messagearea contacts parameters. More...
 
static data_for_messagearea_contacts_is_deprecated ()
 Marking the method as deprecated. More...
 
static data_for_messagearea_contacts_parameters ()
 The messagearea contacts return parameters. More...
 
static data_for_messagearea_contacts_returns ()
 The messagearea contacts return structure. More...
 
static data_for_messagearea_conversations ($userid, $limitfrom=0, $limitnum=0)
 Get messagearea conversations. More...
 
static data_for_messagearea_conversations_is_deprecated ()
 Marking the method as deprecated. More...
 
static data_for_messagearea_conversations_parameters ()
 The messagearea conversations parameters. More...
 
static data_for_messagearea_conversations_returns ()
 The messagearea conversations return structure. More...
 
static data_for_messagearea_get_most_recent_message ($currentuserid, $otheruserid)
 Get the most recent message in a conversation. More...
 
static data_for_messagearea_get_most_recent_message_is_deprecated ()
 Marking the method as deprecated. More...
 
static data_for_messagearea_get_most_recent_message_parameters ()
 The get most recent message return parameters. More...
 
static data_for_messagearea_get_most_recent_message_returns ()
 The get most recent message return structure. More...
 
static data_for_messagearea_get_profile ($currentuserid, $otheruserid)
 Get the profile information for a contact. More...
 
static data_for_messagearea_get_profile_is_deprecated ()
 Marking the method as deprecated. More...
 
static data_for_messagearea_get_profile_parameters ()
 The get profile parameters. More...
 
static data_for_messagearea_get_profile_returns ()
 The get profile return structure. More...
 
static data_for_messagearea_messages ($currentuserid, $otheruserid, $limitfrom=0, $limitnum=0, $newest=false, $timefrom=0)
 Get messagearea messages. More...
 
static data_for_messagearea_messages_is_deprecated ()
 Marking the method as deprecated. More...
 
static data_for_messagearea_messages_parameters ()
 The messagearea messages parameters. More...
 
static data_for_messagearea_messages_returns ()
 The messagearea messages return structure. More...
 
static data_for_messagearea_search_messages ($userid, $search, $limitfrom=0, $limitnum=0)
 Get messagearea search messages results. More...
 
static data_for_messagearea_search_messages_parameters ()
 Get messagearea search messages parameters. More...
 
static data_for_messagearea_search_messages_returns ()
 Get messagearea search messages returns. More...
 
static data_for_messagearea_search_users ($userid, $search, $limitnum=0)
 Get messagearea search users results. More...
 
static data_for_messagearea_search_users_in_course ($userid, $courseid, $search, $limitfrom=0, $limitnum=0)
 Get messagearea search users in course results. More...
 
static data_for_messagearea_search_users_in_course_is_deprecated ()
 Marking the method as deprecated. More...
 
static data_for_messagearea_search_users_in_course_parameters ()
 Get messagearea search users in course parameters. More...
 
static data_for_messagearea_search_users_in_course_returns ()
 Get messagearea search users in course returns. More...
 
static data_for_messagearea_search_users_is_deprecated ()
 Marking the method as deprecated. More...
 
static data_for_messagearea_search_users_parameters ()
 Get messagearea search users parameters. More...
 
static data_for_messagearea_search_users_returns ()
 Get messagearea search users returns. More...
 
static decline_contact_request (int $userid, int $requesteduserid)
 Declines a contact request. More...
 
static decline_contact_request_parameters ()
 Declines a contact request parameters description. More...
 
static decline_contact_request_returns ()
 Declines a contact request return description. More...
 
static delete_contacts ($userids, $userid=0)
 Delete contacts. More...
 
static delete_contacts_parameters ()
 Delete contacts parameters description. More...
 
static delete_contacts_returns ()
 Delete contacts return description. More...
 
static delete_conversation ($userid, $otheruserid)
 Deletes a conversation. More...
 
static delete_conversation_is_deprecated ()
 Marking the method as deprecated. More...
 
static delete_conversation_parameters ()
 Returns description of method parameters. More...
 
static delete_conversation_returns ()
 Returns description of method result value. More...
 
static delete_conversations_by_id ($userid, array $conversationids)
 Deletes a conversation. More...
 
static delete_conversations_by_id_parameters ()
 Returns description of method parameters. More...
 
static delete_conversations_by_id_returns ()
 Returns description of method result value. More...
 
static delete_message ($messageid, $userid, $read=true)
 Deletes a message. More...
 
static delete_message_for_all_users (int $messageid, int $userid)
 Deletes a message for all users. More...
 
static delete_message_for_all_users_parameters ()
 Returns description of method parameters. More...
 
static delete_message_for_all_users_returns ()
 Returns description of method result value. More...
 
static delete_message_parameters ()
 Returns description of method parameters. More...
 
static delete_message_returns ()
 Returns description of method result value. More...
 
static external_function_info ($function, $strictness=MUST_EXIST)
 Returns detailed function information. More...
 
static get_blocked_users ($userid)
 Retrieve a list of users blocked. More...
 
static get_blocked_users_parameters ()
 Get blocked users parameters description. More...
 
static get_blocked_users_returns ()
 Get blocked users return description. More...
 
static get_contact_requests (int $userid, int $limitfrom=0, int $limitnum=0)
 Handles returning the contact requests for a user. More...
 
static get_contact_requests_parameters ()
 Returns contact requests parameters description. More...
 
static get_contact_requests_returns ()
 Returns the contact requests return description. More...
 
static get_contacts ()
 Get contacts. More...
 
static get_contacts_is_deprecated ()
 Marking the method as deprecated. More...
 
static get_contacts_parameters ()
 Get contacts parameters description. More...
 
static get_contacts_returns ()
 Get contacts return description. More...
 
static get_conversation (int $userid, int $conversationid, bool $includecontactrequests=false, bool $includeprivacyinfo=false, int $memberlimit=0, int $memberoffset=0, int $messagelimit=0, int $messageoffset=0, bool $newestmessagesfirst=true)
 Get a single conversation. More...
 
static get_conversation_between_users (int $userid, int $otheruserid, bool $includecontactrequests=false, bool $includeprivacyinfo=false, int $memberlimit=0, int $memberoffset=0, int $messagelimit=0, int $messageoffset=0, bool $newestmessagesfirst=true)
 Get a single conversation between users. More...
 
static get_conversation_between_users_parameters ()
 Get conversation parameters. More...
 
static get_conversation_between_users_returns ()
 Get conversation returns. More...
 
static get_conversation_counts (int $userid)
 Returns an array of conversation counts for the various types of conversations, including favourites. More...
 
static get_conversation_counts_parameters ()
 Returns description of method parameters for get_conversation_counts() method. More...
 
static get_conversation_counts_returns ()
 Get conversation counts return description. More...
 
static get_conversation_members (int $userid, int $conversationid, bool $includecontactrequests=false, bool $includeprivacyinfo=false, int $limitfrom=0, int $limitnum=0)
 Returns a list of conversation members. More...
 
static get_conversation_members_parameters ()
 Returns get conversation members parameters description. More...
 
static get_conversation_members_returns ()
 Returns the get conversation members return description. More...
 
static get_conversation_messages (int $currentuserid, int $convid, int $limitfrom=0, int $limitnum=0, bool $newest=false, int $timefrom=0)
 Get conversation messages. More...
 
static get_conversation_messages_parameters ()
 The conversation messages parameters. More...
 
static get_conversation_messages_returns ()
 The messagearea messages return structure. More...
 
static get_conversation_parameters ()
 Get conversation parameters. More...
 
static get_conversation_returns ()
 Get conversation returns. More...
 
static get_conversations ($userid, $limitfrom=0, $limitnum=0, int $type=null, bool $favourites=null, bool $mergeself=false)
 Get the list of conversations for the user. More...
 
static get_conversations_parameters ()
 Get conversations parameters. More...
 
static get_conversations_returns ()
 Get conversations returns. More...
 
static get_member_info (int $referenceuserid, array $userids, bool $includecontactrequests=false, bool $includeprivacyinfo=false)
 Returns conversation member info for the supplied users, relative to the supplied referenceuserid. More...
 
static get_member_info_parameters ()
 Returns description of method parameters for get_member_info() method. More...
 
static get_member_info_returns ()
 Get member info return description. More...
 
static get_message_processor ($userid=0, $name)
 Get a message processor. More...
 
static get_message_processor_parameters ()
 Returns description of method parameters. More...
 
static get_message_processor_returns ()
 Returns description of method result value. More...
 
static get_messages ($useridto, $useridfrom=0, $type='both', $read=true, $newestfirst=true, $limitfrom=0, $limitnum=0)
 Get messages function implementation. More...
 
static get_messages_parameters ()
 Get messages parameters description. More...
 
static get_messages_returns ()
 Get messages return description. More...
 
static get_received_contact_requests_count (int $userid)
 Returns the number of contact requests the user has received. More...
 
static get_received_contact_requests_count_parameters ()
 Returns the number of contact requests the user has received parameters description. More...
 
static get_received_contact_requests_count_returns ()
 Returns the number of contact requests the user has received return description. More...
 
static get_self_conversation (int $userid, int $messagelimit=0, int $messageoffset=0, bool $newestmessagesfirst=true)
 Get a single self-conversation. More...
 
static get_self_conversation_parameters ()
 Get self-conversation parameters. More...
 
static get_self_conversation_returns ()
 Get conversation returns. More...
 
static get_unread_conversation_counts (int $userid)
 Returns an array of unread conversation counts for the various types of conversations, including favourites. More...
 
static get_unread_conversation_counts_parameters ()
 Returns description of method parameters for get_unread_conversation_counts() method. More...
 
static get_unread_conversation_counts_returns ()
 Get unread conversation counts return description. More...
 
static get_unread_conversations_count ($useridto)
 Get unread messages count function. More...
 
static get_unread_conversations_count_parameters ()
 Get unread conversations count parameters description. More...
 
static get_unread_conversations_count_returns ()
 Get unread conversations count return description. More...
 
static get_user_contacts (int $userid, int $limitfrom=0, int $limitnum=0)
 Get user contacts. More...
 
static get_user_contacts_parameters ()
 The user contacts return parameters. More...
 
static get_user_contacts_returns ()
 The user contacts return structure. More...
 
static get_user_message_preferences ($userid=0)
 Get the notification preferences for a given user. More...
 
static get_user_message_preferences_parameters ()
 Returns description of method parameters. More...
 
static get_user_message_preferences_returns ()
 Returns description of method result value. More...
 
static get_user_notification_preferences ($userid=0)
 Get the notification preferences for a given user. More...
 
static get_user_notification_preferences_parameters ()
 Returns description of method parameters. More...
 
static get_user_notification_preferences_returns ()
 Returns description of method result value. More...
 
static mark_all_conversation_messages_as_read (int $userid, int $conversationid)
 Mark all conversation messages as read function. More...
 
static mark_all_conversation_messages_as_read_parameters ()
 Mark all conversation messages as read parameters description. More...
 
static mark_all_conversation_messages_as_read_returns ()
 Mark all conversation messages as read return description. More...
 
static mark_all_messages_as_read ($useridto, $useridfrom)
 Mark all messages as read function. More...
 
static mark_all_messages_as_read_is_deprecated ()
 Marking the method as deprecated. More...
 
static mark_all_messages_as_read_parameters ()
 Mark all messages as read parameters description. More...
 
static mark_all_messages_as_read_returns ()
 Mark all messages as read return description. More...
 
static mark_all_notifications_as_read ($useridto, $useridfrom)
 Mark all notifications as read function. More...
 
static mark_all_notifications_as_read_parameters ()
 Mark all notifications as read parameters description. More...
 
static mark_all_notifications_as_read_returns ()
 Mark all notifications as read return description. More...
 
static mark_message_read ($messageid, $timeread)
 Mark a single message as read, trigger message_viewed event. More...
 
static mark_message_read_parameters ()
 Returns description of method parameters. More...
 
static mark_message_read_returns ()
 Returns description of method result value. More...
 
static mark_notification_read ($notificationid, $timeread)
 Mark a single notification as read. More...
 
static mark_notification_read_parameters ()
 Returns description of method parameters. More...
 
static mark_notification_read_returns ()
 Returns description of method result value. More...
 
static message_processor_config_form ($userid, $name, $formvalues)
 Processes a message processor config form. More...
 
static message_processor_config_form_parameters ()
 Returns description of method parameters. More...
 
static message_processor_config_form_returns ()
 Returns description of method result value. More...
 
static message_search_users ($userid, $search, $limitfrom=0, $limitnum=0)
 Get search users results. More...
 
static message_search_users_parameters ()
 Get messagearea message search users parameters. More...
 
static message_search_users_returns ()
 Get messagearea message search users returns. More...
 
static mute_conversations (int $userid, array $conversationids)
 Mutes conversations. More...
 
static mute_conversations_parameters ()
 Mute conversations parameters description. More...
 
static mute_conversations_returns ()
 Mute conversations return description. More...
 
static search_contacts ($searchtext, $onlymycourses=false)
 Search contacts. More...
 
static search_contacts_parameters ()
 Search contacts parameters description. More...
 
static search_contacts_returns ()
 Search contacts return description. More...
 
static send_instant_messages ($messages=array())
 Send private messages from the current USER to other users. More...
 
static send_instant_messages_parameters ()
 Returns description of method parameters. More...
 
static send_instant_messages_returns ()
 Returns description of method result value. More...
 
static send_messages_to_conversation (int $conversationid, array $messages=[])
 Send messages from the current USER to a conversation. More...
 
static send_messages_to_conversation_parameters ()
 Returns description of method parameters. More...
 
static send_messages_to_conversation_returns ()
 Returns description of method result value. More...
 
static set_context_restriction ($context)
 Set context restriction for all following subsequent function calls. More...
 
static set_favourite_conversations (int $userid, array $conversationids)
 Favourite a conversation, or list of conversations for a user. More...
 
static set_favourite_conversations_parameters ()
 Returns description of method parameters for the favourite_conversations() method. More...
 
static set_favourite_conversations_returns ()
 Return a description of the returns for the create_user_favourite_conversations() method. More...
 
static set_timeout ($seconds=360)
 This method has to be called before every operation that takes a longer time to finish! More...
 
static unblock_contacts ($userids, $userid=0)
 Unblock contacts. More...
 
static unblock_contacts_is_deprecated ()
 Marking the method as deprecated. More...
 
static unblock_contacts_parameters ()
 Unblock contacts parameters description. More...
 
static unblock_contacts_returns ()
 Unblock contacts return description. More...
 
static unblock_user (int $userid, int $unblockeduserid)
 Unblock user. More...
 
static unblock_user_parameters ()
 Unblock user parameters description. More...
 
static unblock_user_returns ()
 Unblock user return description. More...
 
static unmute_conversations (int $userid, array $conversationids)
 Unmute conversations. More...
 
static unmute_conversations_parameters ()
 Unmute conversations parameters description. More...
 
static unmute_conversations_returns ()
 Unmute conversations return description. More...
 
static unset_favourite_conversations (int $userid, array $conversationids)
 Unfavourite a conversation, or list of conversations for a user. More...
 
static unset_favourite_conversations_parameters ()
 Returns description of method parameters for unfavourite_conversations() method. More...
 
static unset_favourite_conversations_returns ()
 Unset favourite conversations return description. More...
 
static validate_context ($context)
 Makes sure user may execute functions in this context. More...
 
static validate_parameters (external_description $description, $params)
 Validates submitted function parameters, if anything is incorrect invalid_parameter_exception is thrown. More...
 

Static Protected Member Functions

static get_context_from_params ($param)
 Get context from passed parameters. More...
 
static get_context_parameters ()
 Returns a prepared structure to use a context parameters. More...
 
static get_preferences_structure ()
 Returns a notification or message preference structure. More...
 
static validate_preferences_permissions ($userid)
 Check that the user has enough permission to retrieve message or notifications preferences. More...
 

Member Function Documentation

◆ block_contacts()

static core_message_external::block_contacts (   $userids,
  $userid = 0 
)
static

Block contacts.

Deprecated:
since Moodle 3.6
Parameters
array$useridsarray of user IDs.
int$useridThe id of the user we are blocking the contacts for
Return values
external_description
Since
Moodle 2.5

◆ block_contacts_is_deprecated()

static core_message_external::block_contacts_is_deprecated ( )
static

Marking the method as deprecated.

Return values
bool

◆ block_contacts_parameters()

static core_message_external::block_contacts_parameters ( )
static

Block contacts parameters description.

Deprecated:
since Moodle 3.6
Return values
external_function_parameters
Since
Moodle 2.5

◆ block_contacts_returns()

static core_message_external::block_contacts_returns ( )
static

Block contacts return description.

Deprecated:
since Moodle 3.6
Return values
external_description
Since
Moodle 2.5

◆ block_user()

static core_message_external::block_user ( int  $userid,
int  $blockeduserid 
)
static

Blocks a user.

Parameters
int$useridThe id of the user who is blocking
int$blockeduseridThe id of the user being blocked
Return values
external_description

◆ block_user_parameters()

static core_message_external::block_user_parameters ( )
static

Block user parameters description.

Return values
external_function_parameters

◆ block_user_returns()

static core_message_external::block_user_returns ( )
static

Block user return description.

Return values
external_description

◆ call_external_function()

static external_api::call_external_function (   $function,
  $args,
  $ajaxonly = false 
)
staticinherited

Call an external function validating all params/returns correctly.

Note that an external function may modify the state of the current page, so this wrapper saves and restores tha PAGE and COURSE global variables before/after calling the external function.

Parameters
string$functionA webservice function name.
array$argsParams array (named params)
boolean$ajaxonlyIf true, an extra check will be peformed to see if ajax is required.
Return values
arraycontaining keys for error (bool), exception and data.

◆ clean_returnvalue()

static external_api::clean_returnvalue ( external_description  $description,
  $response 
)
staticinherited

Clean response If a response attribute is unknown from the description, we just ignore the attribute.

If a response attribute is incorrect, invalid_response_exception is thrown. Note: this function is similar to validate parameters, however it is distinct because parameters validation must be distinct from cleaning return values.

Parameters
external_description$descriptiondescription of the return values
mixed$responsethe actual response
Return values
mixedresponse with added defaults for optional items, invalid_response_exception thrown if any problem found
Author
2010 Jerome Mouneyrac
Since
Moodle 2.0

◆ confirm_contact_request()

static core_message_external::confirm_contact_request ( int  $userid,
int  $requesteduserid 
)
static

Confirm a contact request.

Parameters
int$useridThe id of the user who is creating the contact request
int$requesteduseridThe id of the user being requested

◆ confirm_contact_request_parameters()

static core_message_external::confirm_contact_request_parameters ( )
static

Confirm a contact request parameters description.

Return values
external_function_parameters

◆ confirm_contact_request_returns()

static core_message_external::confirm_contact_request_returns ( )
static

Confirm a contact request return description.

Return values
external_description

◆ create_contact_request()

static core_message_external::create_contact_request ( int  $userid,
int  $requesteduserid 
)
static

Creates a contact request.

Parameters
int$useridThe id of the user who is creating the contact request
int$requesteduseridThe id of the user being requested

◆ create_contact_request_parameters()

static core_message_external::create_contact_request_parameters ( )
static

Creates a contact request parameters description.

Return values
external_function_parameters

◆ create_contact_request_returns()

static core_message_external::create_contact_request_returns ( )
static

Creates a contact request return description.

Return values
external_description

◆ create_contacts()

static core_message_external::create_contacts (   $userids,
  $userid = 0 
)
static

Create contacts.

Deprecated:
since Moodle 3.6
Parameters
array$useridsarray of user IDs.
int$useridThe id of the user we are creating the contacts for
Return values
external_description
Since
Moodle 2.5

◆ create_contacts_is_deprecated()

static core_message_external::create_contacts_is_deprecated ( )
static

Marking the method as deprecated.

Return values
bool

◆ create_contacts_parameters()

static core_message_external::create_contacts_parameters ( )
static

Create contacts parameters description.

Deprecated:
since Moodle 3.6
Return values
external_function_parameters
Since
Moodle 2.5

◆ create_contacts_returns()

static core_message_external::create_contacts_returns ( )
static

Create contacts return description.

Deprecated:
since Moodle 3.6
Return values
external_description
Since
Moodle 2.5

◆ data_for_messagearea_contacts()

static core_message_external::data_for_messagearea_contacts (   $userid,
  $limitfrom = 0,
  $limitnum = 0 
)
static

Get messagearea contacts parameters.

Deprecated:
since 3.6
Parameters
int$useridThe id of the user who we are viewing conversations for
int$limitfrom
int$limitnum
Return values
stdClass
Exceptions
moodle_exception
Since
3.2

◆ data_for_messagearea_contacts_is_deprecated()

static core_message_external::data_for_messagearea_contacts_is_deprecated ( )
static

Marking the method as deprecated.

Return values
bool

◆ data_for_messagearea_contacts_parameters()

static core_message_external::data_for_messagearea_contacts_parameters ( )
static

The messagearea contacts return parameters.

Deprecated:
since 3.6
Return values
external_function_parameters
Since
3.2

◆ data_for_messagearea_contacts_returns()

static core_message_external::data_for_messagearea_contacts_returns ( )
static

The messagearea contacts return structure.

Deprecated:
since 3.6
Return values
external_single_structure
Since
3.2

◆ data_for_messagearea_conversations()

static core_message_external::data_for_messagearea_conversations (   $userid,
  $limitfrom = 0,
  $limitnum = 0 
)
static

Get messagearea conversations.

NOTE FOR FINAL DEPRECATION: When removing this method, please also consider removal of get_conversations_legacy_formatter() from the core_message\helper class. This helper method was used solely to format the new get_conversations() return data into the old format used here, and in message/index.php. If we no longer need either of these, then that method can be removed.

Deprecated:
since 3.6
Parameters
int$useridThe id of the user who we are viewing conversations for
int$limitfrom
int$limitnum
Return values
stdClass
Exceptions
moodle_exception
Since
3.2

◆ data_for_messagearea_conversations_is_deprecated()

static core_message_external::data_for_messagearea_conversations_is_deprecated ( )
static

Marking the method as deprecated.

Return values
bool

◆ data_for_messagearea_conversations_parameters()

static core_message_external::data_for_messagearea_conversations_parameters ( )
static

The messagearea conversations parameters.

Deprecated:
since 3.6
Return values
external_function_parameters
Since
3.2

◆ data_for_messagearea_conversations_returns()

static core_message_external::data_for_messagearea_conversations_returns ( )
static

The messagearea conversations return structure.

Deprecated:
since 3.6
Return values
external_single_structure
Since
3.2

◆ data_for_messagearea_get_most_recent_message()

static core_message_external::data_for_messagearea_get_most_recent_message (   $currentuserid,
  $otheruserid 
)
static

Get the most recent message in a conversation.

Deprecated:
since 3.6
Parameters
int$currentuseridThe current user's id
int$otheruseridThe other user's id
Return values
stdClass
Exceptions
moodle_exception
Since
3.2

◆ data_for_messagearea_get_most_recent_message_is_deprecated()

static core_message_external::data_for_messagearea_get_most_recent_message_is_deprecated ( )
static

Marking the method as deprecated.

Return values
bool

◆ data_for_messagearea_get_most_recent_message_parameters()

static core_message_external::data_for_messagearea_get_most_recent_message_parameters ( )
static

The get most recent message return parameters.

Deprecated:
since 3.6
Return values
external_function_parameters
Since
3.2

◆ data_for_messagearea_get_most_recent_message_returns()

static core_message_external::data_for_messagearea_get_most_recent_message_returns ( )
static

The get most recent message return structure.

Deprecated:
since 3.6
Return values
external_single_structure
Since
3.2

◆ data_for_messagearea_get_profile()

static core_message_external::data_for_messagearea_get_profile (   $currentuserid,
  $otheruserid 
)
static

Get the profile information for a contact.

Deprecated:
since 3.6
Parameters
int$currentuseridThe current user's id
int$otheruseridThe id of the user whose profile we are viewing
Return values
stdClass
Exceptions
moodle_exception
Since
3.2

◆ data_for_messagearea_get_profile_is_deprecated()

static core_message_external::data_for_messagearea_get_profile_is_deprecated ( )
static

Marking the method as deprecated.

Return values
bool

◆ data_for_messagearea_get_profile_parameters()

static core_message_external::data_for_messagearea_get_profile_parameters ( )
static

The get profile parameters.

Deprecated:
since 3.6
Return values
external_function_parameters
Since
3.2

◆ data_for_messagearea_get_profile_returns()

static core_message_external::data_for_messagearea_get_profile_returns ( )
static

The get profile return structure.

Deprecated:
since 3.6
Return values
external_single_structure
Since
3.2

◆ data_for_messagearea_messages()

static core_message_external::data_for_messagearea_messages (   $currentuserid,
  $otheruserid,
  $limitfrom = 0,
  $limitnum = 0,
  $newest = false,
  $timefrom = 0 
)
static

Get messagearea messages.

Deprecated:
since 3.6
Parameters
int$currentuseridThe current user's id
int$otheruseridThe other user's id
int$limitfrom
int$limitnum
boolean$newest
Return values
stdClass
Exceptions
moodle_exception
Since
3.2

◆ data_for_messagearea_messages_is_deprecated()

static core_message_external::data_for_messagearea_messages_is_deprecated ( )
static

Marking the method as deprecated.

Return values
bool

◆ data_for_messagearea_messages_parameters()

static core_message_external::data_for_messagearea_messages_parameters ( )
static

The messagearea messages parameters.

Deprecated:
since 3.6
Return values
external_function_parameters
Since
3.2

◆ data_for_messagearea_messages_returns()

static core_message_external::data_for_messagearea_messages_returns ( )
static

The messagearea messages return structure.

Deprecated:
since 3.6
Return values
external_single_structure
Since
3.2

◆ data_for_messagearea_search_messages()

static core_message_external::data_for_messagearea_search_messages (   $userid,
  $search,
  $limitfrom = 0,
  $limitnum = 0 
)
static

Get messagearea search messages results.

Parameters
int$useridThe id of the user who is performing the search
string$searchThe string being searched
int$limitfrom
int$limitnum
Return values
stdClass
Exceptions
moodle_exception
Since
3.2

◆ data_for_messagearea_search_messages_parameters()

static core_message_external::data_for_messagearea_search_messages_parameters ( )
static

Get messagearea search messages parameters.

Return values
external_function_parameters
Since
3.2

◆ data_for_messagearea_search_messages_returns()

static core_message_external::data_for_messagearea_search_messages_returns ( )
static

Get messagearea search messages returns.

Return values
external_single_structure
Since
3.2

◆ data_for_messagearea_search_users()

static core_message_external::data_for_messagearea_search_users (   $userid,
  $search,
  $limitnum = 0 
)
static

Get messagearea search users results.

Deprecated:
since 3.6
Parameters
int$useridThe id of the user who is performing the search
string$searchThe string being searched
int$limitnum
Return values
stdClass
Exceptions
moodle_exception
Since
3.2

◆ data_for_messagearea_search_users_in_course()

static core_message_external::data_for_messagearea_search_users_in_course (   $userid,
  $courseid,
  $search,
  $limitfrom = 0,
  $limitnum = 0 
)
static

Get messagearea search users in course results.

Deprecated:
since 3.6
Parameters
int$useridThe id of the user who is performing the search
int$courseidThe id of the course
string$searchThe string being searched
int$limitfrom
int$limitnum
Return values
stdClass
Exceptions
moodle_exception
Since
3.2

◆ data_for_messagearea_search_users_in_course_is_deprecated()

static core_message_external::data_for_messagearea_search_users_in_course_is_deprecated ( )
static

Marking the method as deprecated.

Return values
bool

◆ data_for_messagearea_search_users_in_course_parameters()

static core_message_external::data_for_messagearea_search_users_in_course_parameters ( )
static

Get messagearea search users in course parameters.

Deprecated:
since 3.6
Return values
external_function_parameters
Since
3.2

◆ data_for_messagearea_search_users_in_course_returns()

static core_message_external::data_for_messagearea_search_users_in_course_returns ( )
static

Get messagearea search users in course returns.

Deprecated:
since 3.6
Return values
external_single_structure
Since
3.2

◆ data_for_messagearea_search_users_is_deprecated()

static core_message_external::data_for_messagearea_search_users_is_deprecated ( )
static

Marking the method as deprecated.

Return values
bool

◆ data_for_messagearea_search_users_parameters()

static core_message_external::data_for_messagearea_search_users_parameters ( )
static

Get messagearea search users parameters.

Deprecated:
since 3.6
Return values
external_function_parameters
Since
3.2

◆ data_for_messagearea_search_users_returns()

static core_message_external::data_for_messagearea_search_users_returns ( )
static

Get messagearea search users returns.

Deprecated:
since 3.6
Return values
external_single_structure
Since
3.2

◆ decline_contact_request()

static core_message_external::decline_contact_request ( int  $userid,
int  $requesteduserid 
)
static

Declines a contact request.

Parameters
int$useridThe id of the user who is creating the contact request
int$requesteduseridThe id of the user being requested

◆ decline_contact_request_parameters()

static core_message_external::decline_contact_request_parameters ( )
static

Declines a contact request parameters description.

Return values
external_function_parameters

◆ decline_contact_request_returns()

static core_message_external::decline_contact_request_returns ( )
static

Declines a contact request return description.

Return values
external_description

◆ delete_contacts()

static core_message_external::delete_contacts (   $userids,
  $userid = 0 
)
static

Delete contacts.

Parameters
array$useridsarray of user IDs.
int$useridThe id of the user we are deleting the contacts for
Return values
null
Since
Moodle 2.5

◆ delete_contacts_parameters()

static core_message_external::delete_contacts_parameters ( )
static

Delete contacts parameters description.

Return values
external_function_parameters
Since
Moodle 2.5

◆ delete_contacts_returns()

static core_message_external::delete_contacts_returns ( )
static

Delete contacts return description.

Return values
external_description
Since
Moodle 2.5

◆ delete_conversation()

static core_message_external::delete_conversation (   $userid,
  $otheruserid 
)
static

Deletes a conversation.

Deprecated:
since 3.6
Parameters
int$useridThe user id of who we want to delete the conversation for
int$otheruseridThe user id of the other user in the conversation
Return values
array
Exceptions
moodle_exception
Since
3.2

◆ delete_conversation_is_deprecated()

static core_message_external::delete_conversation_is_deprecated ( )
static

Marking the method as deprecated.

Return values
bool

◆ delete_conversation_parameters()

static core_message_external::delete_conversation_parameters ( )
static

Returns description of method parameters.

Deprecated:
since 3.6
Return values
external_function_parameters
Since
3.2

◆ delete_conversation_returns()

static core_message_external::delete_conversation_returns ( )
static

Returns description of method result value.

Deprecated:
since 3.6
Return values
external_description
Since
3.2

◆ delete_conversations_by_id()

static core_message_external::delete_conversations_by_id (   $userid,
array  $conversationids 
)
static

Deletes a conversation.

Parameters
int$useridThe user id of who we want to delete the conversation for
int[]$conversationidsThe ids of the conversations
Return values
array
Exceptions
moodle_exception
Since
3.6

◆ delete_conversations_by_id_parameters()

static core_message_external::delete_conversations_by_id_parameters ( )
static

Returns description of method parameters.

Return values
external_function_parameters
Since
3.6

◆ delete_conversations_by_id_returns()

static core_message_external::delete_conversations_by_id_returns ( )
static

Returns description of method result value.

Return values
external_description
Since
3.6

◆ delete_message()

static core_message_external::delete_message (   $messageid,
  $userid,
  $read = true 
)
static

Deletes a message.

Parameters
int$messageidthe message id
int$useridthe user id of who we want to delete the message for
bool$readif is a message read (default to true)
Return values
external_description
Exceptions
moodle_exception
Since
3.1

◆ delete_message_for_all_users()

static core_message_external::delete_message_for_all_users ( int  $messageid,
int  $userid 
)
static

Deletes a message for all users.

Parameters
int$messageidthe message id
int$useridthe user id of who we want to delete the message for all users
Return values
external_description
Exceptions
moodle_exception
Since
3.7

◆ delete_message_for_all_users_parameters()

static core_message_external::delete_message_for_all_users_parameters ( )
static

Returns description of method parameters.

Return values
external_function_parameters
Since
3.7

◆ delete_message_for_all_users_returns()

static core_message_external::delete_message_for_all_users_returns ( )
static

Returns description of method result value.

Return values
external_description
Since
3.7

◆ delete_message_parameters()

static core_message_external::delete_message_parameters ( )
static

Returns description of method parameters.

Return values
external_function_parameters
Since
3.1

◆ delete_message_returns()

static core_message_external::delete_message_returns ( )
static

Returns description of method result value.

Return values
external_description
Since
3.1

◆ external_function_info()

static external_api::external_function_info (   $function,
  $strictness = MUST_EXIST 
)
staticinherited

Returns detailed function information.

Parameters
string | object$functionname of external function or record from external_function
int$strictnessIGNORE_MISSING means compatible mode, false returned if record not found, debug message if more found; MUST_EXIST means throw exception if no record or multiple records found
Return values
stdClassdescription or false if not found or exception thrown
Since
Moodle 2.0

◆ get_blocked_users()

static core_message_external::get_blocked_users (   $userid)
static

Retrieve a list of users blocked.

Parameters
int$useridthe user whose blocked users we want to retrieve
Return values
external_description
Since
2.9

◆ get_blocked_users_parameters()

static core_message_external::get_blocked_users_parameters ( )
static

Get blocked users parameters description.

Return values
external_function_parameters
Since
2.9

◆ get_blocked_users_returns()

static core_message_external::get_blocked_users_returns ( )
static

Get blocked users return description.

Return values
external_single_structure
Since
2.9

◆ get_contact_requests()

static core_message_external::get_contact_requests ( int  $userid,
int  $limitfrom = 0,
int  $limitnum = 0 
)
static

Handles returning the contact requests for a user.

This also includes the user data necessary to display information about the user.

It will not include blocked users.

Parameters
int$useridThe id of the user we want to get the contact requests for
int$limitfrom
int$limitnum

◆ get_contact_requests_parameters()

static core_message_external::get_contact_requests_parameters ( )
static

Returns contact requests parameters description.

Return values
external_function_parameters

◆ get_contact_requests_returns()

static core_message_external::get_contact_requests_returns ( )
static

Returns the contact requests return description.

Return values
external_description

◆ get_contacts()

static core_message_external::get_contacts ( )
static

Get contacts.

Deprecated:
since 3.6
Return values
external_description
Since
Moodle 2.5

◆ get_contacts_is_deprecated()

static core_message_external::get_contacts_is_deprecated ( )
static

Marking the method as deprecated.

Return values
bool

◆ get_contacts_parameters()

static core_message_external::get_contacts_parameters ( )
static

Get contacts parameters description.

Deprecated:
since 3.6
Return values
external_function_parameters
Since
Moodle 2.5

◆ get_contacts_returns()

static core_message_external::get_contacts_returns ( )
static

Get contacts return description.

Deprecated:
since 3.6
Return values
external_description
Since
Moodle 2.5

◆ get_context_from_params()

static external_api::get_context_from_params (   $param)
staticprotectedinherited

Get context from passed parameters.

The passed array must either contain a contextid or a combination of context level and instance id to fetch the context. For example, the context level can be "course" and instanceid can be courseid.

See context_helper::get_all_levels() for a list of valid context levels.

Parameters
array$param
Since
Moodle 2.6
Exceptions
invalid_parameter_exception
Return values
context

◆ get_context_parameters()

static external_api::get_context_parameters ( )
staticprotectedinherited

Returns a prepared structure to use a context parameters.

Return values
external_single_structure

Reimplemented in core_competency\external, and tool_lp\external.

◆ get_conversation()

static core_message_external::get_conversation ( int  $userid,
int  $conversationid,
bool  $includecontactrequests = false,
bool  $includeprivacyinfo = false,
int  $memberlimit = 0,
int  $memberoffset = 0,
int  $messagelimit = 0,
int  $messageoffset = 0,
bool  $newestmessagesfirst = true 
)
static

Get a single conversation.

Parameters
int$useridThe user id to get the conversation for
int$conversationidThe id of the conversation to fetch
bool$includecontactrequestsShould contact requests be included between members
bool$includeprivacyinfoShould privacy info be included between members
int$memberlimitLimit number of members to load
int$memberoffsetOffset members by this amount
int$messagelimitLimit number of messages to load
int$messageoffsetOffset the messages
bool$newestmessagesfirstOrder messages by newest first
Return values
stdClass
Exceptions
moodle_exceptionif the messaging feature is disabled on the site.

◆ get_conversation_between_users()

static core_message_external::get_conversation_between_users ( int  $userid,
int  $otheruserid,
bool  $includecontactrequests = false,
bool  $includeprivacyinfo = false,
int  $memberlimit = 0,
int  $memberoffset = 0,
int  $messagelimit = 0,
int  $messageoffset = 0,
bool  $newestmessagesfirst = true 
)
static

Get a single conversation between users.

Parameters
int$useridThe user id to get the conversation for
int$otheruseridThe other user id
bool$includecontactrequestsShould contact requests be included between members
bool$includeprivacyinfoShould privacy info be included between members
int$memberlimitLimit number of members to load
int$memberoffsetOffset members by this amount
int$messagelimitLimit number of messages to load
int$messageoffsetOffset the messages
bool$newestmessagesfirstOrder messages by newest first
Return values
stdClass
Exceptions
moodle_exceptionif the messaging feature is disabled on the site.

◆ get_conversation_between_users_parameters()

static core_message_external::get_conversation_between_users_parameters ( )
static

Get conversation parameters.

Return values
external_function_parameters

◆ get_conversation_between_users_returns()

static core_message_external::get_conversation_between_users_returns ( )
static

Get conversation returns.

Return values
external_single_structure

◆ get_conversation_counts()

static core_message_external::get_conversation_counts ( int  $userid)
static

Returns an array of conversation counts for the various types of conversations, including favourites.

Return format: [ 'favourites' => 0, 'types' => [ core_message\api::MESSAGE_CONVERSATION_TYPE_INDIVIDUAL => 0, core_message\api::MESSAGE_CONVERSATION_TYPE_GROUP => 0 ] ]

Parameters
int$useridthe id of the user whose counts we are fetching.
Return values
arraythe array of conversation counts, indexed by type.
Exceptions
moodle_exceptionif the current user cannot perform this action.

◆ get_conversation_counts_parameters()

static core_message_external::get_conversation_counts_parameters ( )
static

Returns description of method parameters for get_conversation_counts() method.

Return values
external_function_parameters

◆ get_conversation_counts_returns()

static core_message_external::get_conversation_counts_returns ( )
static

Get conversation counts return description.

Return values
external_description

◆ get_conversation_members()

static core_message_external::get_conversation_members ( int  $userid,
int  $conversationid,
bool  $includecontactrequests = false,
bool  $includeprivacyinfo = false,
int  $limitfrom = 0,
int  $limitnum = 0 
)
static

Returns a list of conversation members.

Parameters
int$useridThe user we are returning the conversation members for, used by helper::get_member_info.
int$conversationidThe id of the conversation
bool$includecontactrequestsDo we want to include contact requests with this data?
bool$includeprivacyinfoDo we want to include privacy info?
int$limitfrom
int$limitnum
Return values
array

◆ get_conversation_members_parameters()

static core_message_external::get_conversation_members_parameters ( )
static

Returns get conversation members parameters description.

Return values
external_function_parameters

◆ get_conversation_members_returns()

static core_message_external::get_conversation_members_returns ( )
static

Returns the get conversation members return description.

Return values
external_description

◆ get_conversation_messages()

static core_message_external::get_conversation_messages ( int  $currentuserid,
int  $convid,
int  $limitfrom = 0,
int  $limitnum = 0,
bool  $newest = false,
int  $timefrom = 0 
)
static

Get conversation messages.

Parameters
int$currentuseridThe current user's id.
int$convidThe conversation id.
int$limitfromReturn a subset of records, starting at this point (optional).
int$limitnumReturn a subset comprising this many records in total (optional, required if $limitfrom is set).
bool$newestTrue for getting first newest messages, false otherwise.
int$timefromThe time from the conversation messages to get.
Return values
arrayThe messages and members who have sent some of these messages.
Exceptions
moodle_exception
Since
3.6

◆ get_conversation_messages_parameters()

static core_message_external::get_conversation_messages_parameters ( )
static

The conversation messages parameters.

Return values
external_function_parameters
Since
3.6

◆ get_conversation_messages_returns()

static core_message_external::get_conversation_messages_returns ( )
static

The messagearea messages return structure.

Return values
external_single_structure
Since
3.6

◆ get_conversation_parameters()

static core_message_external::get_conversation_parameters ( )
static

Get conversation parameters.

Return values
external_function_parameters

◆ get_conversation_returns()

static core_message_external::get_conversation_returns ( )
static

Get conversation returns.

Return values
external_single_structure

◆ get_conversations()

static core_message_external::get_conversations (   $userid,
  $limitfrom = 0,
  $limitnum = 0,
int  $type = null,
bool  $favourites = null,
bool  $mergeself = false 
)
static

Get the list of conversations for the user.

Parameters
int$useridThe id of the user who is performing the search
int$limitfrom
int$limitnum
int | null$type
bool | null$favourites
bool$mergeselfwhether to include self-conversations (true) or ONLY private conversations (false) when private conversations are requested.
Return values
stdClass
Exceptions
moodle_exceptionif the messaging feature is disabled on the site.
Since
3.2

◆ get_conversations_parameters()

static core_message_external::get_conversations_parameters ( )
static

Get conversations parameters.

Return values
external_function_parameters
Since
3.6

◆ get_conversations_returns()

static core_message_external::get_conversations_returns ( )
static

Get conversations returns.

Return values
external_single_structure
Since
3.6

◆ get_member_info()

static core_message_external::get_member_info ( int  $referenceuserid,
array  $userids,
bool  $includecontactrequests = false,
bool  $includeprivacyinfo = false 
)
static

Returns conversation member info for the supplied users, relative to the supplied referenceuserid.

This is the basic structure used when returning members, and includes information about the relationship between each member and the referenceuser, such as a whether the referenceuser has marked the member as a contact, or has blocked them.

Parameters
int$referenceuseridthe id of the user which check contact and blocked status.
array$userids
Return values
arraythe array of objects containing member info.
Exceptions
moodle_exceptionif messaging is disabled or if the user cannot perform the action.

◆ get_member_info_parameters()

static core_message_external::get_member_info_parameters ( )
static

Returns description of method parameters for get_member_info() method.

Return values
external_function_parameters

◆ get_member_info_returns()

static core_message_external::get_member_info_returns ( )
static

Get member info return description.

Return values
external_description

◆ get_message_processor()

static core_message_external::get_message_processor (   $userid = 0,
  $name 
)
static

Get a message processor.

Parameters
int$userid
string$namethe name of the processor
Return values
external_description
Exceptions
moodle_exception
Since
3.2

◆ get_message_processor_parameters()

static core_message_external::get_message_processor_parameters ( )
static

Returns description of method parameters.

Return values
external_function_parameters
Since
3.2

◆ get_message_processor_returns()

static core_message_external::get_message_processor_returns ( )
static

Returns description of method result value.

Return values
external_description
Since
3.2

◆ get_messages()

static core_message_external::get_messages (   $useridto,
  $useridfrom = 0,
  $type = 'both',
  $read = true,
  $newestfirst = true,
  $limitfrom = 0,
  $limitnum = 0 
)
static

Get messages function implementation.

Since
2.8
Exceptions
invalid_parameter_exception
moodle_exception
Parameters
int$useridtothe user id who received the message
int$useridfromthe user id who send the message. -10 or -20 for no-reply or support user
string$typetype of message to return, expected values: notifications, conversations and both
bool$readtrue for retreiving read messages, false for unread
bool$newestfirsttrue for ordering by newest first, false for oldest first
int$limitfromlimit from
int$limitnumlimit num
Return values
external_description

◆ get_messages_parameters()

static core_message_external::get_messages_parameters ( )
static

Get messages parameters description.

Return values
external_function_parameters
Since
2.8

◆ get_messages_returns()

static core_message_external::get_messages_returns ( )
static

Get messages return description.

Return values
external_single_structure
Since
2.8

◆ get_preferences_structure()

static core_message_external::get_preferences_structure ( )
staticprotected

Returns a notification or message preference structure.

Return values
external_single_structurethe structure
Since
Moodle 3.2

◆ get_received_contact_requests_count()

static core_message_external::get_received_contact_requests_count ( int  $userid)
static

Returns the number of contact requests the user has received.

Parameters
int$useridThe ID of the user we want to return the number of received contact requests for
Return values
external_value

◆ get_received_contact_requests_count_parameters()

static core_message_external::get_received_contact_requests_count_parameters ( )
static

Returns the number of contact requests the user has received parameters description.

Return values
external_function_parameters

◆ get_received_contact_requests_count_returns()

static core_message_external::get_received_contact_requests_count_returns ( )
static

Returns the number of contact requests the user has received return description.

Return values
external_value

◆ get_self_conversation()

static core_message_external::get_self_conversation ( int  $userid,
int  $messagelimit = 0,
int  $messageoffset = 0,
bool  $newestmessagesfirst = true 
)
static

Get a single self-conversation.

Parameters
int$useridThe user id to get the self-conversation for
int$messagelimitLimit number of messages to load
int$messageoffsetOffset the messages
bool$newestmessagesfirstOrder messages by newest first
Return values
stdClass
Exceptions
moodle_exceptionif the messaging feature is disabled on the site.
Since
Moodle 3.7

◆ get_self_conversation_parameters()

static core_message_external::get_self_conversation_parameters ( )
static

Get self-conversation parameters.

Return values
external_function_parameters

◆ get_self_conversation_returns()

static core_message_external::get_self_conversation_returns ( )
static

Get conversation returns.

Return values
external_single_structure

◆ get_unread_conversation_counts()

static core_message_external::get_unread_conversation_counts ( int  $userid)
static

Returns an array of unread conversation counts for the various types of conversations, including favourites.

Return format: [ 'favourites' => 0, 'types' => [ core_message\api::MESSAGE_CONVERSATION_TYPE_INDIVIDUAL => 0, core_message\api::MESSAGE_CONVERSATION_TYPE_GROUP => 0 ] ]

Parameters
int$useridthe id of the user whose counts we are fetching.
Return values
arraythe array of unread conversation counts, indexed by type.
Exceptions
moodle_exceptionif the current user cannot perform this action.

◆ get_unread_conversation_counts_parameters()

static core_message_external::get_unread_conversation_counts_parameters ( )
static

Returns description of method parameters for get_unread_conversation_counts() method.

Return values
external_function_parameters

◆ get_unread_conversation_counts_returns()

static core_message_external::get_unread_conversation_counts_returns ( )
static

Get unread conversation counts return description.

Return values
external_description

◆ get_unread_conversations_count()

static core_message_external::get_unread_conversations_count (   $useridto)
static

Get unread messages count function.

Since
3.2
Exceptions
invalid_parameter_exception
moodle_exception
Parameters
int$useridtothe user id who received the message
Return values
external_description

◆ get_unread_conversations_count_parameters()

static core_message_external::get_unread_conversations_count_parameters ( )
static

Get unread conversations count parameters description.

Return values
external_function_parameters
Since
3.2

◆ get_unread_conversations_count_returns()

static core_message_external::get_unread_conversations_count_returns ( )
static

Get unread conversations count return description.

Return values
external_single_structure
Since
3.2

◆ get_user_contacts()

static core_message_external::get_user_contacts ( int  $userid,
int  $limitfrom = 0,
int  $limitnum = 0 
)
static

Get user contacts.

Parameters
int$useridThe id of the user who we are viewing conversations for
int$limitfrom
int$limitnum
Return values
array
Exceptions
moodle_exception

◆ get_user_contacts_parameters()

static core_message_external::get_user_contacts_parameters ( )
static

The user contacts return parameters.

Return values
external_function_parameters

◆ get_user_contacts_returns()

static core_message_external::get_user_contacts_returns ( )
static

The user contacts return structure.

Return values
external_multiple_structure

◆ get_user_message_preferences()

static core_message_external::get_user_message_preferences (   $userid = 0)
static

Get the notification preferences for a given user.

Parameters
int$useridid of the user, 0 for current user
Return values
external_description
Exceptions
moodle_exception
Since
3.2

◆ get_user_message_preferences_parameters()

static core_message_external::get_user_message_preferences_parameters ( )
static

Returns description of method parameters.

Return values
external_function_parameters
Since
3.2

◆ get_user_message_preferences_returns()

static core_message_external::get_user_message_preferences_returns ( )
static

Returns description of method result value.

Return values
external_description
Since
3.2

◆ get_user_notification_preferences()

static core_message_external::get_user_notification_preferences (   $userid = 0)
static

Get the notification preferences for a given user.

Parameters
int$useridid of the user, 0 for current user
Return values
external_description
Exceptions
moodle_exception
Since
3.2

◆ get_user_notification_preferences_parameters()

static core_message_external::get_user_notification_preferences_parameters ( )
static

Returns description of method parameters.

Return values
external_function_parameters
Since
3.2

◆ get_user_notification_preferences_returns()

static core_message_external::get_user_notification_preferences_returns ( )
static

Returns description of method result value.

Return values
external_description
Since
3.2

◆ mark_all_conversation_messages_as_read()

static core_message_external::mark_all_conversation_messages_as_read ( int  $userid,
int  $conversationid 
)
static

Mark all conversation messages as read function.

Parameters
int$useridThe user id of who we want to delete the conversation for
int$conversationidThe id of the conversations
Since
3.6

◆ mark_all_conversation_messages_as_read_parameters()

static core_message_external::mark_all_conversation_messages_as_read_parameters ( )
static

Mark all conversation messages as read parameters description.

Return values
external_function_parameters
Since
3.6

◆ mark_all_conversation_messages_as_read_returns()

static core_message_external::mark_all_conversation_messages_as_read_returns ( )
static

Mark all conversation messages as read return description.

Return values
external_warnings
Since
3.6

◆ mark_all_messages_as_read()

static core_message_external::mark_all_messages_as_read (   $useridto,
  $useridfrom 
)
static

Mark all messages as read function.

Deprecated:
since 3.6
Exceptions
invalid_parameter_exception
moodle_exception
Parameters
int$useridtothe user id who received the message
int$useridfromthe user id who send the message. -10 or -20 for no-reply or support user
Return values
external_description
Since
3.2

◆ mark_all_messages_as_read_is_deprecated()

static core_message_external::mark_all_messages_as_read_is_deprecated ( )
static

Marking the method as deprecated.

Return values
bool

◆ mark_all_messages_as_read_parameters()

static core_message_external::mark_all_messages_as_read_parameters ( )
static

Mark all messages as read parameters description.

Deprecated:
since 3.6
Return values
external_function_parameters
Since
3.2

◆ mark_all_messages_as_read_returns()

static core_message_external::mark_all_messages_as_read_returns ( )
static

Mark all messages as read return description.

Deprecated:
since 3.6
Return values
external_single_structure
Since
3.2

◆ mark_all_notifications_as_read()

static core_message_external::mark_all_notifications_as_read (   $useridto,
  $useridfrom 
)
static

Mark all notifications as read function.

Since
3.2
Exceptions
invalid_parameter_exception
moodle_exception
Parameters
int$useridtothe user id who received the message
int$useridfromthe user id who send the message. -10 or -20 for no-reply or support user
Return values
external_description

◆ mark_all_notifications_as_read_parameters()

static core_message_external::mark_all_notifications_as_read_parameters ( )
static

Mark all notifications as read parameters description.

Return values
external_function_parameters
Since
3.2

◆ mark_all_notifications_as_read_returns()

static core_message_external::mark_all_notifications_as_read_returns ( )
static

Mark all notifications as read return description.

Return values
external_single_structure
Since
3.2

◆ mark_message_read()

static core_message_external::mark_message_read (   $messageid,
  $timeread 
)
static

Mark a single message as read, trigger message_viewed event.

Parameters
int$messageidid of the message (in the message table)
int$timereadtimestamp for when the message should be marked read
Return values
external_description
Exceptions
invalid_parameter_exception
moodle_exception
Since
2.9

◆ mark_message_read_parameters()

static core_message_external::mark_message_read_parameters ( )
static

Returns description of method parameters.

Return values
external_function_parameters
Since
2.9

◆ mark_message_read_returns()

static core_message_external::mark_message_read_returns ( )
static

Returns description of method result value.

Return values
external_description
Since
2.9

◆ mark_notification_read()

static core_message_external::mark_notification_read (   $notificationid,
  $timeread 
)
static

Mark a single notification as read.

This will trigger a 'notification_viewed' event.

Parameters
int$notificationidid of the notification
int$timereadtimestamp for when the notification should be marked read
Return values
external_description
Exceptions
invalid_parameter_exception
moodle_exception

◆ mark_notification_read_parameters()

static core_message_external::mark_notification_read_parameters ( )
static

Returns description of method parameters.

Return values
external_function_parameters

◆ mark_notification_read_returns()

static core_message_external::mark_notification_read_returns ( )
static

Returns description of method result value.

Return values
external_description

◆ message_processor_config_form()

static core_message_external::message_processor_config_form (   $userid,
  $name,
  $formvalues 
)
static

Processes a message processor config form.

Parameters
int$useridthe user id
string$namethe name of the processor
array$formvaluesthe form values
Return values
external_description
Exceptions
moodle_exception
Since
3.2

◆ message_processor_config_form_parameters()

static core_message_external::message_processor_config_form_parameters ( )
static

Returns description of method parameters.

Return values
external_function_parameters
Since
3.2

◆ message_processor_config_form_returns()

static core_message_external::message_processor_config_form_returns ( )
static

Returns description of method result value.

Return values
external_description
Since
3.2

◆ message_search_users()

static core_message_external::message_search_users (   $userid,
  $search,
  $limitfrom = 0,
  $limitnum = 0 
)
static

Get search users results.

Parameters
int$useridThe id of the user who is performing the search
string$searchThe string being searched
int$limitfrom
int$limitnum
Return values
array
Exceptions
moodle_exception
Since
3.6

◆ message_search_users_parameters()

static core_message_external::message_search_users_parameters ( )
static

Get messagearea message search users parameters.

Return values
external_function_parameters
Since
3.6

◆ message_search_users_returns()

static core_message_external::message_search_users_returns ( )
static

Get messagearea message search users returns.

Return values
external_single_structure
Since
3.2

◆ mute_conversations()

static core_message_external::mute_conversations ( int  $userid,
array  $conversationids 
)
static

Mutes conversations.

Parameters
int$useridThe id of the user who is blocking
array$conversationidsThe list of conversations being muted
Return values
external_description

◆ mute_conversations_parameters()

static core_message_external::mute_conversations_parameters ( )
static

Mute conversations parameters description.

Return values
external_function_parameters

◆ mute_conversations_returns()

static core_message_external::mute_conversations_returns ( )
static

Mute conversations return description.

Return values
external_description

◆ search_contacts()

static core_message_external::search_contacts (   $searchtext,
  $onlymycourses = false 
)
static

Search contacts.

Parameters
string$searchtextquery string.
bool$onlymycourseslimit the search to the user's courses only.
Return values
external_description
Since
Moodle 2.5

◆ search_contacts_parameters()

static core_message_external::search_contacts_parameters ( )
static

Search contacts parameters description.

Return values
external_function_parameters
Since
Moodle 2.5

◆ search_contacts_returns()

static core_message_external::search_contacts_returns ( )
static

Search contacts return description.

Return values
external_description
Since
Moodle 2.5

◆ send_instant_messages()

static core_message_external::send_instant_messages (   $messages = array())
static

Send private messages from the current USER to other users.

Parameters
array$messagesAn array of message to send.
Return values
array
Since
Moodle 2.2

◆ send_instant_messages_parameters()

static core_message_external::send_instant_messages_parameters ( )
static

Returns description of method parameters.

Return values
external_function_parameters
Since
Moodle 2.2

◆ send_instant_messages_returns()

static core_message_external::send_instant_messages_returns ( )
static

Returns description of method result value.

Return values
external_description
Since
Moodle 2.2

◆ send_messages_to_conversation()

static core_message_external::send_messages_to_conversation ( int  $conversationid,
array  $messages = [] 
)
static

Send messages from the current USER to a conversation.

This conversation may be any type of conversation, individual or group.

Parameters
int$conversationidthe id of the conversation to which the messages will be sent.
array$messagesAn array of message to send.
Return values
arraythe array of messages which were sent (created).
Since
Moodle 3.6

◆ send_messages_to_conversation_parameters()

static core_message_external::send_messages_to_conversation_parameters ( )
static

Returns description of method parameters.

Return values
external_function_parameters
Since
Moodle 3.6

◆ send_messages_to_conversation_returns()

static core_message_external::send_messages_to_conversation_returns ( )
static

Returns description of method result value.

Return values
external_description
Since
Moodle 3.6

◆ set_context_restriction()

static external_api::set_context_restriction (   $context)
staticinherited

Set context restriction for all following subsequent function calls.

Parameters
stdClass$contextthe context restriction
Since
Moodle 2.0

◆ set_favourite_conversations()

static core_message_external::set_favourite_conversations ( int  $userid,
array  $conversationids 
)
static

Favourite a conversation, or list of conversations for a user.

Parameters
int$useridthe id of the user, or 0 for the current user.
array$conversationidsthe list of conversations ids to favourite.
Return values
array
Exceptions
moodle_exceptionif messaging is disabled or if the user cannot perform the action.

◆ set_favourite_conversations_parameters()

static core_message_external::set_favourite_conversations_parameters ( )
static

Returns description of method parameters for the favourite_conversations() method.

Return values
external_function_parameters

◆ set_favourite_conversations_returns()

static core_message_external::set_favourite_conversations_returns ( )
static

Return a description of the returns for the create_user_favourite_conversations() method.

Return values
external_description

◆ set_timeout()

static external_api::set_timeout (   $seconds = 360)
staticinherited

This method has to be called before every operation that takes a longer time to finish!

Parameters
int$secondsmax expected time the next operation needs
Since
Moodle 2.0

◆ unblock_contacts()

static core_message_external::unblock_contacts (   $userids,
  $userid = 0 
)
static

Unblock contacts.

Parameters
array$useridsarray of user IDs.
int$useridThe id of the user we are unblocking the contacts for
Return values
null
Since
Moodle 2.5

◆ unblock_contacts_is_deprecated()

static core_message_external::unblock_contacts_is_deprecated ( )
static

Marking the method as deprecated.

Return values
bool

◆ unblock_contacts_parameters()

static core_message_external::unblock_contacts_parameters ( )
static

Unblock contacts parameters description.

Deprecated:
since Moodle 3.6
Return values
external_function_parameters
Since
Moodle 2.5

◆ unblock_contacts_returns()

static core_message_external::unblock_contacts_returns ( )
static

Unblock contacts return description.

Deprecated:
since Moodle 3.6
Return values
external_description
Since
Moodle 2.5

◆ unblock_user()

static core_message_external::unblock_user ( int  $userid,
int  $unblockeduserid 
)
static

Unblock user.

Parameters
int$useridThe id of the user who is unblocking
int$unblockeduseridThe id of the user being unblocked

◆ unblock_user_parameters()

static core_message_external::unblock_user_parameters ( )
static

Unblock user parameters description.

Return values
external_function_parameters

◆ unblock_user_returns()

static core_message_external::unblock_user_returns ( )
static

Unblock user return description.

Return values
external_description

◆ unmute_conversations()

static core_message_external::unmute_conversations ( int  $userid,
array  $conversationids 
)
static

Unmute conversations.

Parameters
int$useridThe id of the user who is unblocking
array$conversationidsThe list of conversations being muted

◆ unmute_conversations_parameters()

static core_message_external::unmute_conversations_parameters ( )
static

Unmute conversations parameters description.

Return values
external_function_parameters

◆ unmute_conversations_returns()

static core_message_external::unmute_conversations_returns ( )
static

Unmute conversations return description.

Return values
external_description

◆ unset_favourite_conversations()

static core_message_external::unset_favourite_conversations ( int  $userid,
array  $conversationids 
)
static

Unfavourite a conversation, or list of conversations for a user.

Parameters
int$useridthe id of the user, or 0 for the current user.
array$conversationidsthe list of conversations ids unset as favourites.
Return values
array
Exceptions
moodle_exceptionif messaging is disabled or if the user cannot perform the action.

◆ unset_favourite_conversations_parameters()

static core_message_external::unset_favourite_conversations_parameters ( )
static

Returns description of method parameters for unfavourite_conversations() method.

Return values
external_function_parameters

◆ unset_favourite_conversations_returns()

static core_message_external::unset_favourite_conversations_returns ( )
static

Unset favourite conversations return description.

Return values
external_description

◆ validate_context()

static external_api::validate_context (   $context)
staticinherited

Makes sure user may execute functions in this context.

Parameters
stdClass$context
Since
Moodle 2.0

◆ validate_parameters()

static external_api::validate_parameters ( external_description  $description,
  $params 
)
staticinherited

Validates submitted function parameters, if anything is incorrect invalid_parameter_exception is thrown.

This is a simple recursive method which is intended to be called from each implementation method of external API.

Parameters
external_description$descriptiondescription of parameters
mixed$paramsthe actual parameters
Return values
mixedparams with added defaults for optional items, invalid_parameters_exception thrown if any problem found
Since
Moodle 2.0

◆ validate_preferences_permissions()

static core_message_external::validate_preferences_permissions (   $userid)
staticprotected

Check that the user has enough permission to retrieve message or notifications preferences.

Parameters
int$useridthe user id requesting the preferences
Return values
stdClassfull user object
Exceptions
moodle_exception
Since
Moodle 3.2

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