* Update sequence of multiple thresholds * * @param array $orderedIds * @return bool */
(array $orderedIds)
| 198 | * @return bool |
| 199 | */ |
| 200 | public function reorder(array $orderedIds): bool { |
| 201 | $position = 1; |
| 202 | $reportId = 0; |
| 203 | foreach ($orderedIds as $id) { |
| 204 | $thresholdReportId = $this->ThresholdMapper->getOwnReportByThreshold((int)$id); |
| 205 | if ($thresholdReportId === 0) { |
| 206 | return false; |
| 207 | } |
| 208 | $reportId = $thresholdReportId; |
| 209 | $this->ThresholdMapper->updateSequence((int)$id, $position); |
| 210 | $position++; |
| 211 | } |
| 212 | $this->logger->info('reportId: ' . $reportId); |
| 213 | if ($reportId !== 0 && !empty($this->ReportMapper->readOwn($reportId))) { |
| 214 | $this->ReportMapper->increaseVersionByReport($reportId); |
| 215 | } |
| 216 | |
| 217 | return true; |
| 218 | } |
| 219 | |
| 220 | /** |
| 221 | * validate notification thresholds per report |
nothing calls this directly
no test coverage detected