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

Method reorder

lib/Service/ThresholdService.php:174–192  ·  view source on GitHub ↗

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

(array $orderedIds)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 5

updateSequenceMethod · 0.80
infoMethod · 0.45
readOwnMethod · 0.45

Tested by

no test coverage detected