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

Method read

lib/Controller/OutputController.php:83–110  ·  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->getDatasourceCacheKey(
92 $reportMetadata,
93 $this->getRequestCacheKey()
94 );
95 }
96
97 // internal storage reports are validated directly against version
98 if ((int)$reportMetadata['type'] === DatasourceController::DATASET_TYPE_INTERNAL_DB) {
99 $response = $this->evaluateIfNoneMatch($reportMetadata);
100 if ($response instanceof DataResponse && $filteroptions === null) {
101 return $response;
102 }
103 }
104
105 // external datasource caching is evaluated by datasource specific logic
106 return $this->returnDataWithCacheableHeader($reportMetadata, $filteroptions);
107 } else {
108 return new NotFoundResponse();
109 }
110 }
111
112 /**
113 * 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 6

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

Tested by

no test coverage detected