• Модуль: timeman
  • Путь к файлу: ~/bitrix/modules/timeman/lib/service/schedule/scheduleservice.php
  • Класс: BitrixTimemanServiceScheduleScheduleService
  • Вызов: ScheduleService::delete
public function delete($scheduleId)
{
	$schedule = $this->scheduleProvider->findByIdWith((int)$scheduleId, ['USER_ASSIGNMENTS', 'DEPARTMENTS']);
	if (!$schedule)
	{
		return (new ScheduleServiceResult())->addScheduleNotFoundError();
	}
	return $this->wrapAction(function () use ($schedule) {
		$schedule->markDeleted();
		$res = $this->safeRun($this->scheduleProvider->save($schedule));
		$this->safeRun($this->shiftService->deleteFutureShiftPlans($schedule));
		$this->violationRulesService->deletePeriodTimeLackAgents($schedule->getId());

		$this->cleanCache();

		return ScheduleServiceResult::createByResult($res);
	});
}