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]

(no description)

File Size: 283 lines (10 kb)
Included or required:0 times
Referenced: 2 times
Includes or requires: 0 files

Defines 2 classes

comment_manager:: (5 methods):
  __construct()
  get_comments()
  setup_course()
  setup_plugin()
  print_comments()

for:: (3 methods):
  delete_comment()
  delete_comments()
  get_component_comments_since()


Class: comment_manager  - X-Ref

comment_manager is helper class to manage moodle comments in admin page (Reports->Comments)

__construct()   X-Ref
Constructs the comment_manage object


get_comments($page)   X-Ref
Return comments by pages

param: int $page
return: array An array of comments

setup_course($courseid)   X-Ref
Records the course object

param: int $courseid

setup_plugin($comment)   X-Ref
Sets up the module or block information for a comment

param: stdClass $comment
return: bool

print_comments($page = 0)   X-Ref
Print comments

param: int $page
return: bool return false if no comments available

Class: for  - X-Ref

delete_comment($commentid)   X-Ref
Delete a comment

param: int $commentid
return: bool

delete_comments($list)   X-Ref
Delete comments

param: string $list A list of comment ids separated by hyphens
return: bool

get_component_comments_since($course, $context, $component, $since, $cm = null)   X-Ref
Get comments created since a given time.

param: stdClass $course    course object
param: stdClass $context   context object
param: string $component   component name
param: int $since          the time to check
param: stdClass $cm        course module object
return: array list of comments db records since the given timelimit