-
Notifications
You must be signed in to change notification settings - Fork 12
Methods: Comments
Fabian Beiner edited this page Nov 15, 2017
·
2 revisions
Method:
getAllComments($type, $typeId); // $type has to be "project" or "task"
// Alternatives:
getAllCommentsByTask($taskId);
getAllCommentsByProject($projectId);
Example:
$allComments = $Todoist->getAllComments('project', '2168427837');
print_r($allComments);
Array
(
[0] => stdClass Object
(
[id] => 2214937295
[project_id] => 2168427837
[posted] => 2017-11-15T18:51:13Z
[content] => Remember the budget! :-o
)
)
Method:
createComment($type, $typeId, $comment); // $type has to be "project" or "task"
// Alternatives:
createCommentForTask($taskId, $comment);
createCommentForProject($projectId, $comment);
Example:
$comment = $Todoist->createComment('project', '2168427837', 'But I got money!');
print_r($comment);
stdClass Object
(
[id] => 2214942717
[project_id] => 2168427837
[posted] => 2017-11-15T19:17:50Z
[content] => But I got money!
)
Method:
getComment($commentId);
Example:
$comment = $Todoist->getComment('2214942717');
print_r($comment);
stdClass Object
(
[id] => 2214942717
[project_id] => 2168427837
[posted] => 2017-11-15T19:17:50Z
[content] => But I got money!
)
Method:
updateComment($commentId, $content);
Example:
$success = $Todoist->updateComment('2214942717', 'OK OK. I got _some_ money.');
print_r($success);
1
Method:
deleteComment($commentId);
Example:
$success = $Todoist->deleteComment('2214942717');
print_r($success);
1
👋