MCPcopy Create free account
hub / github.com/Rello/analytics / delete

Method delete

lib/Controller/DatasetController.php:97–109  ·  view source on GitHub ↗

* Delete Dataset and all depending objects * * @param int $datasetId * @return DataResponse * @throws \OCP\DB\Exception */

(int $datasetId)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

isOwnMethod · 0.45
reportsForDatasetMethod · 0.45

Tested by

no test coverage detected