* Delete Dataset and all depending objects * * @param int $datasetId * @return DataResponse * @throws \OCP\DB\Exception */
(int $datasetId)
| 95 | * @throws \OCP\DB\Exception |
| 96 | */ |
| 97 | #[NoAdminRequired] |
| 98 | public function delete(int $datasetId) { |
| 99 | if ($this->DatasetService->isOwn($datasetId)) { |
| 100 | $reports = $this->ReportService->reportsForDataset($datasetId); |
| 101 | foreach ($reports as $report) { |
| 102 | $this->ReportService->delete((int)$report['id']); |
| 103 | } |
| 104 | $this->DatasetService->delete($datasetId); |
| 105 | return new DataResponse('true'); |
| 106 | } else { |
| 107 | return new DataResponse('false'); |
| 108 | } |
| 109 | } |
| 110 | |
| 111 | /** |
| 112 | * get dataset details |
nothing calls this directly
no test coverage detected