• Модуль: tasks
  • Путь к файлу: ~/bitrix/modules/tasks/lib/rest/controllers/scrum/epic.php
  • Класс: BitrixTasksRestControllersScrumEpic
  • Вызов: Epic::deleteAction
public function deleteAction(int $id)
{
	$id = (int) $id;
	if (!$id)
	{
		$this->errorCollection->add([new Error('Epic not found')]);

		return null;
	}

	$epicService = new EpicService();

	$epic = $epicService->getEpic($id);
	if (!$epic->getId())
	{
		$this->errorCollection->add([new Error('Epic not found')]);

		return null;
	}
	if (!$this->checkAccess($epic->getGroupId()))
	{
		$this->errorCollection->add([new Error('Access denied')]);

		return null;
	}

	if (!$epicService->removeEpic($epic))
	{
		$this->errorCollection->add([new Error('Epic not deleted')]);
	}

	$epicService->deleteFiles($this->getUserFieldManager(), $epic->getId());

	return [];
}