add
array|boolean public static \Bitrix\Tasks\Integration\Forum\Task\Comment::add( $taskId, $messageText, boolean $authorId, array $files );
Method adds new comment to task. Static method.
Parameters
Parameter | Description | Version |
---|---|---|
$taskId | Task ID | |
$messageText | Comment text | |
$authorId | Comment author ID | |
$files | Time identifiers are attached (i. e. 'n17') to files that were uploaded to disk |
Examples
$result = \Bitrix\Tasks\Integration\Forum\Task\Comment::add($taskId, $arFields); // get RESULT of execution if(!$result->isSuccess()) { // when error occurs, throw exception throw new TasksException(serialize($result->getErrors()->getMessages()), TasksException::TE_ACTION_FAILED_TO_BE_PROCESSED | TasksException::TE_FLAG_SERIALIZED_ERRORS_IN_MESSAGE); } $resultData = $result->getData(); // when there were no errors, get data that was inserted into comment return $resultData['ID']; // for example, to return comment ID
© «Bitrix24», 2001-2024