Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.3.x will end 7 October 2024 (12 months).
  • Bug fixes for security issues in 4.3.x will end 21 April 2025 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.2.x is supported too.

Differences Between: [Versions 310 and 403] [Versions 311 and 403] [Versions 39 and 403] [Versions 400 and 403] [Versions 401 and 403]

External comment API

Copyright: Costantino Cito <ccito@cvaconsulting.com>
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 372 lines (15 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: core_comment_external  - X-Ref

External comment API functions

get_comments_parameters()   X-Ref
Returns description of method parameters

return: external_function_parameters

get_comments($contextlevel, $instanceid, $component, $itemid, $area = '', $page = 0,$sortdirection = 'DESC')   X-Ref
Return a list of comments

param: string $contextlevel ('system, course, user', etc..)
param: int $instanceid
param: string $component the name of the component
param: int $itemid the item id
param: string $area comment area
param: int $page page number
param: string $sortdirection sort direction
return: array of comments and warnings

get_comments_returns()   X-Ref
Returns description of method result value

return: \core_external\external_description

get_comment_structure()   X-Ref
Helper to get the structure of a single comment.

return: external_single_structure the comment structure.

add_comments_parameters()   X-Ref
Returns description of method parameters for the add_comments method.

return: external_function_parameters

add_comments($comments)   X-Ref
Add a comment or comments.

param: array $comments the array of comments to create.
return: array the array containing those comments created.

add_comments_returns()   X-Ref
Returns description of method result value for the add_comments method.

return: \core_external\external_description

delete_comments_parameters()   X-Ref
Returns description of method parameters for the delete_comments() method.

return: external_function_parameters

delete_comments(array $comments)   X-Ref
Deletes a comment or comments.

param: array $comments array of comment ids to be deleted
return: array

delete_comments_returns()   X-Ref
Returns description of method result value for the delete_comments() method.

return: \core_external\external_description