* @param array $values * @throws Exception */
(string $table, int $id, array $values)
| 560 | * @throws Exception |
| 561 | */ |
| 562 | private function updateById(string $table, int $id, array $values): void { |
| 563 | if ($values === []) { |
| 564 | return; |
| 565 | } |
| 566 | |
| 567 | $sql = $this->db->getQueryBuilder(); |
| 568 | $sql->update($table); |
| 569 | |
| 570 | foreach ($values as $column => $value) { |
| 571 | $sql->set($column, $sql->createNamedParameter($value)); |
| 572 | } |
| 573 | |
| 574 | $sql->where($sql->expr()->eq('id', $sql->createNamedParameter($id))); |
| 575 | $sql->executeStatement(); |
| 576 | } |
| 577 | |
| 578 | /** |
| 579 | * @param array<string,mixed> $values |
no test coverage detected