* get own report details * * @param int $reportId * @return array * @throws Exception */
(int $reportId, $replace = true)
| 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 |
no test coverage detected