• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/controller/timeline/comment.php
  • Класс: Bitrix\Crm\Controller\Timeline\Comment
  • Вызов: Comment::addAction
public function addAction(array $fields): ?int
{
	[$ownerId, $ownerTypeId, $content, $authorId, $filesList, $fileTokensOrId] = $this->fetchFieldsToAdd($fields);
	if (!$this->assertValidOwner($ownerId, $ownerTypeId))
	{
		return null;
	}

	if (!$this->assertValidCommentContent($content))
	{
		return null;
	}

	if (!empty($fileTokensOrId) && $this->getScope() === static::SCOPE_AJAX)
	{
		$filesList = $this->saveFilesToStorage($ownerTypeId, $ownerId, $fileTokensOrId);
	}

	return $this->add($ownerTypeId, $ownerId, $content, $filesList, $authorId);
}