• Модуль: tasks
  • Путь к файлу: ~/bitrix/modules/tasks/lib/dispatcher/publicaction/task.php
  • Класс: Bitrix\Tasks\Dispatcher\PublicAction\Task
  • Вызов: Task::delete
public function delete($id, array $parameters = array())
{
	$result = [];

	if (!TaskAccessController::can($this->userId, ActionDictionary::ACTION_TASK_REMOVE, (int)$id))
	{
		$this->addForbiddenError();
		return $result;
	}

	if ($id = $this->checkTaskId($id))
	{
		$result['ID' ] = $id;

		// todo: move to \Bitrix\Tasks\Item\Task
		// this will ONLY delete tags, members, favorites, old depedences, old files, clear cache
		$task = \CTaskItem::getInstance($id, Util\User::getId());
		$task->delete();
	}

	return $result;
}