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

Method readPanorama

lib/Controller/OutputController.php:121–145  ·  view source on GitHub ↗

* get the data when requested from a panorama * Special checks are performed to ensure, that the report is really part of the shared panorama * If-None-Match and eTags are being handled * * @param int $reportIds * @return DataResponse|NotFoundResponse * @throws Exception */

(int $reportId)

Source from the content-addressed store, hash-verified

119 * @throws Exception
120 */
121 #[NoAdminRequired]
122 public function readPanorama(int $reportId) {
123 $reportMetadata = $this->ReportService->read($reportId);
124 if (empty($reportMetadata)) $reportMetadata = $this->ShareService->getSharedPanoramaReport($reportId);
125
126 if (!empty($reportMetadata)) {
127 $reportMetadata['cacheKey'] = $this->getDatasourceCacheKey(
128 $reportMetadata,
129 $this->getRequestCacheKey()
130 );
131
132 // internal storage reports are validated directly against version
133 if ((int)$reportMetadata['type'] === DatasourceController::DATASET_TYPE_INTERNAL_DB) {
134 $response = $this->evaluateIfNoneMatch($reportMetadata);
135 if ($response instanceof DataResponse) {
136 return $response;
137 }
138 }
139
140 // external datasource caching is evaluated by datasource specific logic
141 return $this->returnDataWithCacheableHeader($reportMetadata, null);
142 } else {
143 return new NotFoundResponse();
144 }
145 }
146
147 private function returnDataWithCacheableHeader($reportMetadata, $filteroptions) {
148 $result = $this->getData($reportMetadata);

Callers

nothing calls this directly

Calls 6

getDatasourceCacheKeyMethod · 0.95
getRequestCacheKeyMethod · 0.95
evaluateIfNoneMatchMethod · 0.95
readMethod · 0.45

Tested by

no test coverage detected