• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/controller/timeline/comment.php
  • Класс: Bitrix\Crm\Controller\Timeline\Comment
  • Вызов: Comment::updateFilesAction
public function updateFilesAction(int $id, array $files, int $ownerTypeId, int $ownerId): ?array
{
	if (!$this->assertValidCommentRecord($id))
	{
		return null;
	}

	if (!$this->assertValidOwner($ownerId, $ownerTypeId))
	{
		return null;
	}

	[$isBindingsExist, $bindings] = $this->detectBindings($id, $ownerId, $ownerTypeId);
	if (!$isBindingsExist)
	{
		$this->addError(ErrorCode::getNotFoundError());

		return null;
	}

	$filesList = $this->saveFilesToStorage($ownerTypeId, $ownerId, $files, $id);

	$entity = $this->load($id);
	$content = ($entity ? $entity->getComment() : null);

	$commentId = $this->update($id, $ownerTypeId, $ownerId, $content, $filesList, $bindings);

	return $commentId ? ['id' => $commentId] : null;
}