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

Method delete

lib/Service/ReportService.php:338–352  ·  view source on GitHub ↗

* Delete Dataset and all depending objects * * @param int $reportId * @return string * @throws Exception */

(int $reportId)

Source from the content-addressed store, hash-verified

336 * @throws Exception
337 */
338 public function delete(int $reportId) {
339 $metadata = $this->ReportMapper->readOwn($reportId);
340 $this->ActivityManager->triggerEvent($reportId, ActivityManager::OBJECT_REPORT, ActivityManager::SUBJECT_REPORT_DELETE);
341 $this->ShareService->deleteSharesByItem(ShareService::SHARE_ITEM_TYPE_REPORT, $reportId);
342 $this->ThresholdMapper->deleteThresholdByReport($reportId);
343 $this->setFavorite($reportId, 'false');
344 $this->ReportMapper->delete($reportId);
345
346 $report = $this->reportsForDataset((int)$metadata['dataset']);
347 if (empty($report) && (int)$metadata['type'] === DatasourceController::DATASET_TYPE_INTERNAL_DB) {
348 return $metadata['dataset'];
349 } else {
350 return 'true';
351 }
352 }
353
354 /**
355 * get dataset by user

Callers 1

deleteByUserMethod · 0.45

Calls 6

setFavoriteMethod · 0.95
reportsForDatasetMethod · 0.95
triggerEventMethod · 0.80
readOwnMethod · 0.45
deleteSharesByItemMethod · 0.45

Tested by

no test coverage detected