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

Method read

lib/Service/ReportService.php:136–151  ·  view source on GitHub ↗

* get own report details * * @param int $reportId * @return array * @throws Exception */

(int $reportId, $replace = true)

Source from the content-addressed store, hash-verified

134 * @throws Exception
135 */
136 public function read(int $reportId, $replace = true) {
137 $ownReport = $this->ReportMapper->readOwn($reportId);
138 if (!empty($ownReport)) {
139 $ownReport['permissions'] = \OCP\Constants::PERMISSION_UPDATE;
140 if ($replace) $ownReport = $this->VariableService->replaceTextVariables($ownReport);
141
142 if ($ownReport['type'] === DatasourceController::DATASET_TYPE_INTERNAL_DB && $ownReport['dataset'] !== 0) {
143 $dataset = $this->DatasetService->readOwn($ownReport['dataset']);
144 $ownReport['dimension1'] = $dataset['dimension1'];
145 $ownReport['dimension2'] = $dataset['dimension2'];
146 $ownReport['value'] = $dataset['value'];
147 }
148
149 }
150 return $ownReport;
151 }
152
153 /**
154 * check if own report

Callers 1

exportMethod · 0.45

Calls 2

replaceTextVariablesMethod · 0.80
readOwnMethod · 0.45

Tested by

no test coverage detected