aboutsummaryrefslogtreecommitdiff
path: root/app/Models/EntryDAO.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2023-05-03 15:30:18 +0200
committerGravatar GitHub <noreply@github.com> 2023-05-03 15:30:18 +0200
commit675c56f5799ed92a6aa3a8ad3d3d8d6636f444ec (patch)
treee49ba1e5514497010b3170d05d71b869af260135 /app/Models/EntryDAO.php
parent0a38aa7456ccb2875aac5dc20a6f15d3956bb93a (diff)
Fix entries count (#5368)
Parameters warning with some databases
Diffstat (limited to 'app/Models/EntryDAO.php')
-rw-r--r--app/Models/EntryDAO.php4
1 files changed, 3 insertions, 1 deletions
diff --git a/app/Models/EntryDAO.php b/app/Models/EntryDAO.php
index 8d32e86f9..3ef3254b0 100644
--- a/app/Models/EntryDAO.php
+++ b/app/Models/EntryDAO.php
@@ -1331,11 +1331,13 @@ SQL;
public function count(?int $minPriority = null): int {
$sql = 'SELECT COUNT(e.id) AS count FROM `_entry` e';
+ $values = [];
if ($minPriority !== null) {
$sql .= ' INNER JOIN `_feed` f ON e.id_feed=f.id';
$sql .= ' WHERE f.priority > :priority';
+ $values[':priority'] = $minPriority;
}
- $res = $this->fetchColumn($sql, 0, [':priority' => $minPriority]);
+ $res = $this->fetchColumn($sql, 0, $values);
return isset($res[0]) ? (int)($res[0]) : -1;
}