Files
FreshRSS/app/Models/CategoryDAOPGSQL.php
Alexandre Alapetite aeb55693e4 SQL improve PHP syntax uniformity (#8604)
* New SQL wrapper function `fetchInt()`
* Favour use of `fetchAssoc()`, `fetchInt()`, `fetchColumn()`
* Favour Nowdoc / Heredoc syntax for SQL
    * Update indenting to PHP 8.1+ convention
* Favour `bindValue()` instead of position `?` when possible
* Favour `bindValue()` over `bindParam()`
* More uniform and robust syntax when using `bindValue()`, checking return code
2026-03-15 14:44:39 +01:00

14 lines
323 B
PHP

<?php
declare(strict_types=1);
final class FreshRSS_CategoryDAOPGSQL extends FreshRSS_CategoryDAO {
#[\Override]
public function sqlResetSequence(): bool {
$sql = <<<'SQL'
SELECT setval('`_category_id_seq`', COALESCE(MAX(id), 0) + 1, false) FROM `_category`
SQL;
return $this->pdo->exec($sql) !== false;
}
}