• Модуль: tasks
  • Путь к файлу: ~/bitrix/modules/tasks/lib/scrum/controllers/epic.php
  • Класс: BitrixTasksScrumControllersEpic
  • Вызов: Epic::removeEpicAction
public function removeEpicAction(int $epicId): ?array
{
	$userId = UtilUser::getId();

	$epicService = new EpicService();
	$pushService = (Loader::includeModule('pull') ? new PushService() : null);

	$epic = $epicService->getEpic($epicId);
	if (!$epic->getId())
	{
		$this->errorCollection->setError(
			new Error(Loc::getMessage('TASKS_EC_ERROR_COULD_NOT_READ_EPIC'))
		);

		return null;
	}

	if (!Group::canReadGroupTasks($userId, $epic->getGroupId()))
	{
		$this->errorCollection->setError(
			new Error(
				Loc::getMessage('TASKS_EC_ERROR_ACCESS_DENIED'),
				self::ERROR_ACCESS_DENIED
			)
		);

		return null;
	}

	if (!$epicService->removeEpic($epic, $pushService))
	{
		$this->errorCollection->setError(
			new Error(Loc::getMessage('TASKS_EC_ERROR_COULD_NOT_DELETE_EPIC'))
		);

		return null;
	}

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

	return $epic->toArray();
}