Moodle PHP Documentation 4.5
Moodle 4.5dev (Build: 20240606) (d3ae1391abe)
|
Static Public Member Functions | |
static | add_discussion ($forumid, $subject, $message, $groupid=0, $options=array()) |
Add a new discussion into an existing forum. | |
static | add_discussion_parameters () |
Returns description of method parameters. | |
static | add_discussion_post ($postid, $subject, $message, $options=array(), $messageformat=FORMAT_HTML) |
Create new posts into an existing discussion. | |
static | add_discussion_post_parameters () |
Returns description of method parameters. | |
static | add_discussion_post_returns () |
Returns description of method result value. | |
static | add_discussion_returns () |
Returns description of method result value. | |
static | can_add_discussion ($forumid, $groupid=null) |
Check if the current user can add discussions in the given forum (and optionally for the given group). | |
static | can_add_discussion_parameters () |
Returns description of method parameters. | |
static | can_add_discussion_returns () |
Returns description of method result value. | |
static | delete_post ($postid) |
Deletes a post or a discussion completely when the post is the discussion topic. | |
static | delete_post_parameters () |
Returns description of method parameters. | |
static | delete_post_returns () |
Returns description of method result value. | |
static | get_discussion_post ($postid) |
Get a particular discussion post. | |
static | get_discussion_post_parameters () |
Returns description of method parameters. | |
static | get_discussion_post_returns () |
Returns description of method result value. | |
static | get_discussion_posts (int $discussionid, ?string $sortby, ?string $sortdirection, bool $includeinlineattachments=false) |
Get the forum posts in the specified discussion. | |
static | get_discussion_posts_by_userid (int $userid, int $cmid, ?string $sortby, ?string $sortdirection) |
Get the forum posts in the specified forum instance. | |
static | get_discussion_posts_by_userid_parameters () |
Describe the post parameters. | |
static | get_discussion_posts_by_userid_returns () |
Describe the post return format. | |
static | get_discussion_posts_parameters () |
Describe the post parameters. | |
static | get_discussion_posts_returns () |
Describe the post return format. | |
static | get_forum_access_information ($forumid) |
Return access information for a given forum. | |
static | get_forum_access_information_parameters () |
Describes the parameters for get_forum_access_information. | |
static | get_forum_access_information_returns () |
Describes the get_forum_access_information return value. | |
static | get_forum_discussions (int $forumid, ?int $sortorder=-1, ?int $page=-1, ?int $perpage=0, ?int $groupid=0) |
Returns a list of forum discussions optionally sorted and paginated. | |
static | get_forum_discussions_parameters () |
Describes the parameters for get_forum_discussions. | |
static | get_forum_discussions_returns () |
Describes the get_forum_discussions return value. | |
static | get_forums_by_courses ($courseids=array()) |
Returns a list of forums in a provided list of courses, if no list is provided all forums that the user can view will be returned. | |
static | get_forums_by_courses_parameters () |
Describes the parameters for get_forum. | |
static | get_forums_by_courses_returns () |
Describes the get_forum return value. | |
static | prepare_draft_area_for_post ($postid, $area, $draftitemid=0, $filestokeep=[]) |
Prepares a draft area for editing a post. | |
static | prepare_draft_area_for_post_parameters () |
Returns description of method parameters. | |
static | prepare_draft_area_for_post_returns () |
Returns description of method result value. | |
static | set_lock_state ($forumid, $discussionid, $targetstate) |
Set the lock state. | |
static | set_lock_state_parameters () |
Returns description of method parameters. | |
static | set_lock_state_returns () |
Returns description of method result value. | |
static | set_pin_state ($discussionid, $targetstate) |
Set the pin state. | |
static | set_pin_state_parameters () |
Returns description of method parameters. | |
static | set_pin_state_returns () |
Returns description of method result value. | |
static | set_subscription_state ($forumid, $discussionid, $targetstate) |
Set the subscription state. | |
static | set_subscription_state_parameters () |
Returns description of method parameters. | |
static | set_subscription_state_returns () |
Returns description of method result value. | |
static | toggle_favourite_state ($discussionid, $targetstate) |
Toggle the favouriting value for the discussion provided. | |
static | toggle_favourite_state_parameters () |
Defines the parameters for the toggle_favourite_state method. | |
static | toggle_favourite_state_returns () |
Returns description of method result value. | |
static | update_discussion_post ($postid, $subject='', $message='', $messageformat=FORMAT_HTML, $options=[]) |
Updates a post or a discussion post topic. | |
static | update_discussion_post_parameters () |
Returns description of method parameters. | |
static | update_discussion_post_returns () |
Returns description of method result value. | |
static | view_forum ($forumid) |
Trigger the course module viewed event and update the module completion status. | |
static | view_forum_discussion ($discussionid) |
Trigger the discussion viewed event. | |
static | view_forum_discussion_parameters () |
Returns description of method parameters. | |
static | view_forum_discussion_returns () |
Returns description of method result value. | |
static | view_forum_parameters () |
Returns description of method parameters. | |
static | view_forum_returns () |
Returns description of method result value. | |
|
static |
Add a new discussion into an existing forum.
int | $forumid | the forum instance id |
string | $subject | new discussion subject |
string | $message | new discussion message (only html format allowed) |
int | $groupid | the user course group |
array | $options | optional settings |
array | of warnings and the new discussion id |
moodle_exception |
|
static |
Returns description of method parameters.
external_function_parameters |
|
static |
Create new posts into an existing discussion.
int | $postid | the post id we are going to reply to |
string | $subject | new post subject |
string | $message | new post message (html assumed if messageformat is not provided) |
array | $options | optional settings |
string | $messageformat | The format of the message, defaults to FORMAT_HTML for BC |
array | of warnings and the new post id |
moodle_exception |
|
static |
Returns description of method parameters.
external_function_parameters |
|
static |
Returns description of method result value.
core_external\external_description |
|
static |
Returns description of method result value.
core_external\external_description |
|
static |
Check if the current user can add discussions in the given forum (and optionally for the given group).
int | $forumid | the forum instance id |
int | $groupid | the group to check, default to active group. Use -1 to check if the user can post in all the groups. |
array | of warnings and the status (true if the user can add discussions) |
moodle_exception |
|
static |
Returns description of method parameters.
external_function_parameters |
|
static |
Returns description of method result value.
core_external\external_description |
|
static |
Deletes a post or a discussion completely when the post is the discussion topic.
int | $postid | post to be deleted, it can be a discussion topic post. |
array | of warnings and the status (true if the post/discussion was deleted) |
moodle_exception |
|
static |
Returns description of method parameters.
external_function_parameters |
|
static |
Returns description of method result value.
core_external\external_description |
|
static |
Get a particular discussion post.
int | $postid | post to fetch |
array | of post and warnings (if any) |
moodle_exception |
|
static |
Returns description of method parameters.
external_function_parameters |
|
static |
Returns description of method result value.
core_external\external_description |
|
static |
Get the forum posts in the specified discussion.
int | $discussionid | |
string | $sortby | |
string | $sortdirection | |
bool | $includeinlineattachments | Whether inline attachments should be included or not. |
array |
|
static |
Get the forum posts in the specified forum instance.
int | $userid | |
int | $cmid | |
string | $sortby | |
string | $sortdirection |
array |
|
static |
Describe the post parameters.
external_function_parameters |
|
static |
Describe the post return format.
external_single_structure |
|
static |
Describe the post parameters.
external_function_parameters |
|
static |
Describe the post return format.
external_single_structure |
|
static |
Return access information for a given forum.
int | $forumid | forum instance id |
array | of warnings and the access information |
moodle_exception |
|
static |
Describes the parameters for get_forum_access_information.
external_external_function_parameters |
|
static |
Describes the get_forum_access_information return value.
external_single_structure |
|
static |
Returns a list of forum discussions optionally sorted and paginated.
int | $forumid | the forum instance id |
int | $sortorder | The sort order |
int | $page | page number |
int | $perpage | items per page |
int | $groupid | the user course group |
array | the forum discussion details including warnings |
|
static |
Describes the parameters for get_forum_discussions.
external_function_parameters |
|
static |
Describes the get_forum_discussions return value.
external_single_structure |
|
static |
Returns a list of forums in a provided list of courses, if no list is provided all forums that the user can view will be returned.
array | $courseids | the course ids |
array | the forum details |
|
static |
|
static |
|
static |
Prepares a draft area for editing a post.
int | $postid | post to prepare the draft area for |
string | $area | area to prepare attachment or post |
int | $draftitemid | the draft item id to use. 0 to generate a new one. |
array | $filestokeep | only keep these files in the draft file area. Empty for keeping all. |
array | of files in the area, the area options and the draft item id |
moodle_exception |
|
static |
Returns description of method parameters.
external_function_parameters |
|
static |
Returns description of method result value.
core_external\external_description |
|
static |
Set the lock state.
int | $forumid | |
int | $discussionid | |
string | $targetstate |
stdClass |
|
static |
Returns description of method parameters.
external_function_parameters |
|
static |
Returns description of method result value.
core_external\external_description |
|
static |
Set the pin state.
int | $discussionid | |
bool | $targetstate |
stdClass |
|
static |
Returns description of method parameters.
external_function_parameters |
|
static |
Returns description of method result value.
external_single_structure |
|
static |
Set the subscription state.
int | $forumid | |
int | $discussionid | |
bool | $targetstate |
stdClass |
|
static |
Returns description of method parameters.
external_function_parameters |
|
static |
Returns description of method result value.
core_external\external_description |
|
static |
Toggle the favouriting value for the discussion provided.
int | $discussionid | The discussion we need to favourite |
bool | $targetstate | The state of the favourite value |
array | The exported discussion |
|
static |
Defines the parameters for the toggle_favourite_state method.
external_function_parameters |
|
static |
Returns description of method result value.
core_external\external_description |
|
static |
Updates a post or a discussion post topic.
int | $postid | post to be updated, it can be a discussion topic post. |
string | $subject | updated post subject |
string | $message | updated post message (HTML assumed if messageformat is not provided) |
int | $messageformat | The format of the message, defaults to FORMAT_HTML |
array | $options | different configuration options for the post to be updated. |
array | of warnings and the status (true if the post/discussion was deleted) |
moodle_exception |
|
static |
Returns description of method parameters.
external_function_parameters |
|
static |
Returns description of method result value.
core_external\external_description |
|
static |
Trigger the course module viewed event and update the module completion status.
int | $forumid | the forum instance id |
array | of warnings and status result |
moodle_exception |
|
static |
Trigger the discussion viewed event.
int | $discussionid | the discussion id |
array | of warnings and status result |
moodle_exception |
|
static |
Returns description of method parameters.
external_function_parameters |
|
static |
Returns description of method result value.
core_external\external_description |
|
static |
Returns description of method parameters.
external_function_parameters |
|
static |
Returns description of method result value.
core_external\external_description |