This article covers managing comments in activeCollab using the API Wrapper.

1. Fetching a comment

object ActiveCollab::findCommentById(int $project_id, int $comment_id) - Fetches an ActiveCollabComment object

Parameters:

project_id - id of the Project where the comment is located comment_id - id of a specific comment

Return value: Object instance of ActiveCollabComment

2. Creating a new comment

object $comment = new ActiveCollabComment(int $project_id) - Creates a new ActiveCollabComment object

Parameters:

project_id - id of the Project where the comment will be created

Variable value: Object instance of ActiveCollabComment

3. Editing and saving a comment

These methods are called out through an comment object.

•   setCreatedByEmail(string $email)  -  Sets an email of the user who created this comment
•   setCreatedByName(string $name)  -  Sets the name of the user who created this comment
•   setBody(string $body)  -  Sets the description of this comment
•   setParentId(int $parent_id) - Sets the parent for this comment
•   addAttachments(array of file $arr_files) - Adds array of files to a comment
•   save(void) - Saves the comment object into activeCollab