• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/controller/activity/todo.php
  • Класс: Bitrix\Crm\Controller\Activity\ToDo
  • Вызов: ToDo::updateFilesAction
public function updateFilesAction(
	int $ownerTypeId,
	int $ownerId,
	int $id,
	array $fileTokens = []
): ?array
{
	$todo = $this->loadEntity($ownerTypeId, $ownerId, $id);
	if (!$todo)
	{
		return null;
	}

	if ($todo->isCompleted())
	{
		$this->addError(new Error( Loc::getMessage('CRM_ACTIVITY_TODO_UPDATE_FILES_ERROR')));

		return null;
	}

	$todo->setStorageElementIds(
		$this->saveFilesToStorage(
			$ownerTypeId,
			$ownerId,
			$fileTokens,
			$id,
			$todo->getStorageElementIds() ?? []
		)
	);

	return $this->saveTodo($todo);
}