• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/controller/timeline/comment.php
  • Класс: Bitrix\Crm\Controller\Timeline\Comment
  • Вызов: Comment::update
protected function update(int $commentId, int $ownerTypeId, int $ownerId, string $content, array $filesList, array $bindings): ?int
{
	$oldContent = $this->load($commentId)->getComment();

	if (count($bindings) > 1)
	{
		$commentId = $this->copy($commentId, $ownerTypeId, $ownerId, $filesList);
	}

	$updateResult = CommentEntry::update($commentId, [
		'COMMENT' => $content,
		'SETTINGS' => ['HAS_FILES' => empty($filesList) ? 'N' : 'Y'],
		'FILES' => $filesList,
	]);

	if ($updateResult->isSuccess())
	{
		CommentController::getInstance()->onModify($commentId, [
			'COMMENT' => $content,
			'ENTITY_TYPE_ID' => $ownerTypeId,
			'ENTITY_ID' => $ownerId,
			'OLD_MENTION_LIST' => CommentController::getMentionIds($oldContent)
		]);

		return $updateResult->getId();
	}

	$this->addErrors($updateResult->getErrors());

	return null;
}