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

Method delete

lib/Service/ReportService.php:332–346  ·  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

330 * @throws Exception
331 */
332 public function delete(int $reportId) {
333 $metadata = $this->ReportMapper->readOwn($reportId);
334 $this->ActivityManager->triggerEvent($reportId, ActivityManager::OBJECT_REPORT, ActivityManager::SUBJECT_REPORT_DELETE);
335 $this->ShareService->deleteSharesByItem(ShareService::SHARE_ITEM_TYPE_REPORT, $reportId);
336 $this->ThresholdMapper->deleteThresholdByReport($reportId);
337 $this->setFavorite($reportId, 'false');
338 $this->ReportMapper->delete($reportId);
339
340 $report = $this->reportsForDataset((int)$metadata['dataset']);
341 if (empty($report) && (int)$metadata['type'] === DatasourceController::DATASET_TYPE_INTERNAL_DB) {
342 return $metadata['dataset'];
343 } else {
344 return 'true';
345 }
346 }
347
348 /**
349 * 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