* Update sequence of multiple thresholds * * @param array $orderedIds * @return bool */
(array $orderedIds)
| 172 | * @return bool |
| 173 | */ |
| 174 | public function reorder(array $orderedIds): bool { |
| 175 | $position = 1; |
| 176 | $reportId = 0; |
| 177 | foreach ($orderedIds as $id) { |
| 178 | $thresholdReportId = $this->ThresholdMapper->getOwnReportByThreshold((int)$id); |
| 179 | if ($thresholdReportId === 0) { |
| 180 | return false; |
| 181 | } |
| 182 | $reportId = $thresholdReportId; |
| 183 | $this->ThresholdMapper->updateSequence((int)$id, $position); |
| 184 | $position++; |
| 185 | } |
| 186 | $this->logger->info('reportId: ' . $reportId); |
| 187 | if ($reportId !== 0 && !empty($this->ReportMapper->readOwn($reportId))) { |
| 188 | $this->ReportMapper->increaseVersionByReport($reportId); |
| 189 | } |
| 190 | |
| 191 | return true; |
| 192 | } |
| 193 | |
| 194 | /** |
| 195 | * validate notification thresholds per report |
nothing calls this directly
no test coverage detected