* @param array $values * @throws Exception */
(string $table, int $id, array $values)
| 417 | * @throws Exception |
| 418 | */ |
| 419 | private function updateById(string $table, int $id, array $values): void { |
| 420 | if ($values === []) { |
| 421 | return; |
| 422 | } |
| 423 | |
| 424 | $sql = $this->db->getQueryBuilder(); |
| 425 | $sql->update($table); |
| 426 | |
| 427 | foreach ($values as $column => $value) { |
| 428 | $sql->set($column, $sql->createNamedParameter($value)); |
| 429 | } |
| 430 | |
| 431 | $sql->where($sql->expr()->eq('id', $sql->createNamedParameter($id))); |
| 432 | $sql->executeStatement(); |
| 433 | } |
| 434 | |
| 435 | /** |
| 436 | * @param array<string,mixed> $values |
no test coverage detected