/** * @param int $scheduleId * @param int $moveResourcesToThisScheduleId */ public function Delete($scheduleId, $moveResourcesToThisScheduleId) { $resources = $this->resourceRepository->GetScheduleResources($scheduleId); foreach ($resources as $resource) { $resource->SetScheduleId($moveResourcesToThisScheduleId); $this->resourceRepository->Update($resource); } $schedule = $this->scheduleRepository->LoadById($scheduleId); $this->scheduleRepository->Delete($schedule); }