Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

Differences Between: [Versions 311 and 402] [Versions 311 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: 365 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: 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: 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: external_description