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

Method reorder

lib/Service/ThresholdService.php:200–218  ·  view source on GitHub ↗

* Update sequence of multiple thresholds * * @param array $orderedIds * @return bool */

(array $orderedIds)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 5

updateSequenceMethod · 0.80
infoMethod · 0.45
readOwnMethod · 0.45

Tested by

no test coverage detected