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

Method read

lib/Controller/OutputController.php:83–107  ·  view source on GitHub ↗

* get the data when requested from internal page * If-None-Match and eTags are being handled * * @param int $reportId * @param $filteroptions * @param $dataoptions * @param $chartoptions * @param $tableoptions * @return DataResponse|NotFoundResponse * @throws Exception */

(int $reportId, $filteroptions, $dataoptions, $chartoptions, $tableoptions)

Source from the content-addressed store, hash-verified

81 * @throws Exception
82 */
83 #[NoAdminRequired]
84 public function read(int $reportId, $filteroptions, $dataoptions, $chartoptions, $tableoptions) {
85 $reportMetadata = $this->ReportService->read($reportId);
86 if (empty($reportMetadata)) $reportMetadata = $this->ShareService->getSharedReport($reportId);
87
88 if (!empty($reportMetadata)) {
89 $reportMetadata = $this->evaluateCanFilter($reportMetadata, $filteroptions, $dataoptions, $chartoptions, $tableoptions);
90 if ($filteroptions === null) {
91 $reportMetadata['cacheKey'] = $this->getRequestCacheKey();
92 }
93
94 // internal storage reports are validated directly against version
95 if ((int)$reportMetadata['type'] === DatasourceController::DATASET_TYPE_INTERNAL_DB) {
96 $response = $this->evaluateIfNoneMatch($reportMetadata);
97 if ($response instanceof DataResponse && $filteroptions === null) {
98 return $response;
99 }
100 }
101
102 // external datasource caching is evaluated by datasource specific logic
103 return $this->returnDataWithCacheableHeader($reportMetadata, $filteroptions);
104 } else {
105 return new NotFoundResponse();
106 }
107 }
108
109 /**
110 * get the data when requested from a panorama

Callers 9

readPanoramaMethod · 0.45
getDataMethod · 0.45
dataGetV3Method · 0.45
reportDetailV3Method · 0.45
readReportMethod · 0.45
readPanoramaMethod · 0.45
submitContentMethod · 0.45
isActiveForDatasetMethod · 0.45

Calls 5

evaluateCanFilterMethod · 0.95
getRequestCacheKeyMethod · 0.95
evaluateIfNoneMatchMethod · 0.95
getSharedReportMethod · 0.80

Tested by

no test coverage detected