Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

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