• Модуль: tasks
  • Путь к файлу: ~/bitrix/modules/tasks/classes/general/elapseditem.php
  • Класс: CTaskElapsedItem
  • Вызов: CTaskElapsedItem::update
public function update(array $fields): void
{
	if (empty($fields))
	{
		return;
	}

	if (!$this->isActionAllowed(self::ACTION_ELAPSED_TIME_MODIFY))
	{
		throw new TasksException('', TasksException::TE_ACTION_NOT_ALLOWED);
	}

	static $allowedFields = ['MINUTES', 'SECONDS', 'COMMENT_TEXT', 'CREATED_DATE'];
	if (count(array_diff(array_keys($fields), $allowedFields)) > 0)
	{
		throw new TasksException('', TasksException::TE_WRONG_ARGUMENTS);
	}

	/** @noinspection PhpDeprecationInspection */
	$rc = (new CTaskElapsedTime())->Update($this->itemId, $fields, ['USER_ID' => $this->executiveUserId]);

	// Reset tagged system cache by tag 'tasks_user_' . $userId for each task member
	$this->resetSystemWideTasksCacheByTag();

	// Reset cache
	$this->resetCache();

	if (!$rc)
	{
		throw new TasksException('', TasksException::TE_ACTION_FAILED_TO_BE_PROCESSED);
	}
}