Moodle APIs 3.9
Moodle 3.9.13+ (Build: 20220325)
Public Member Functions | List of all members
comment_manager Class Reference

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

Public Member Functions

 __construct ()
 Constructs the comment_manage object.
 
 delete_comment ($commentid)
 Delete a comment. More...
 
 delete_comments ($list)
 Delete comments. More...
 
moodle_database get_comments ($page)
 Return comments by pages. More...
 
 get_component_comments_since ($course, $context, $component, $since, $cm=null)
 Get comments created since a given time. More...
 
 print_comments ($page=0)
 Print comments. More...
 

Detailed Description

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

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Member Function Documentation

◆ delete_comment()

comment_manager::delete_comment (   $commentid)

Delete a comment.

Parameters
int$commentid
Return values
bool

◆ delete_comments()

comment_manager::delete_comments (   $list)

Delete comments.

Parameters
string$listA list of comment ids separated by hyphens
Return values
bool

◆ get_comments()

moodle_database comment_manager::get_comments (   $page)

Return comments by pages.

$DB

Parameters
int$page
Return values
arrayAn array of comments

◆ get_component_comments_since()

comment_manager::get_component_comments_since (   $course,
  $context,
  $component,
  $since,
  $cm = null 
)

Get comments created since a given time.

Parameters
stdClass$coursecourse object
stdClass$contextcontext object
string$componentcomponent name
int$sincethe time to check
stdClass$cmcourse module object
Return values
arraylist of comments db records since the given timelimit
Since
Moodle 3.2

◆ print_comments()

comment_manager::print_comments (   $page = 0)

Print comments.

Parameters
int$page
Return values
boolreturn false if no comments available

The documentation for this class was generated from the following file: