* Update the sequence of one threshold * * @param int $thresholdId * @param int $sequence * @return bool * @throws Exception */
(int $thresholdId, int $sequence)
| 155 | * @throws Exception |
| 156 | */ |
| 157 | public function updateSequence(int $thresholdId, int $sequence) |
| 158 | { |
| 159 | $sql = $this->db->getQueryBuilder(); |
| 160 | $sql->update(self::TABLE_NAME) |
| 161 | ->set('sequence', $sql->createNamedParameter($sequence)) |
| 162 | ->where($sql->expr()->eq('id', $sql->createNamedParameter($thresholdId))) |
| 163 | ->andWhere($sql->expr()->eq('user_id', $sql->createNamedParameter($this->userId))); |
| 164 | $sql->executeStatement(); |
| 165 | return true; |
| 166 | } |
| 167 | } |