aboutsummaryrefslogtreecommitdiff
path: root/app/Models/CategoryDAO.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2024-10-21 13:41:16 +0200
committerGravatar GitHub <noreply@github.com> 2024-10-21 13:41:16 +0200
commitaea9ba0d62b86be05e53747c97bfcbc8f4bc4408 (patch)
tree5be022f67f0cd2fab8f7d09113e09608cdddc5aa /app/Models/CategoryDAO.php
parentad2c6e6fbf3658f08295fb437a0f97e10498eb11 (diff)
New option mark article as read if identical title in category (#6922)
* New mark articles as read if identical title in category fix https://github.com/FreshRSS/FreshRSS/issues/6143 * i18n todo forgotten
Diffstat (limited to 'app/Models/CategoryDAO.php')
-rw-r--r--app/Models/CategoryDAO.php14
1 files changed, 14 insertions, 0 deletions
diff --git a/app/Models/CategoryDAO.php b/app/Models/CategoryDAO.php
index 2e9892df9..6b563b0a8 100644
--- a/app/Models/CategoryDAO.php
+++ b/app/Models/CategoryDAO.php
@@ -388,6 +388,20 @@ SQL;
return isset($res[0]) ? (int)$res[0] : -1;
}
+ /** @return array<int,string> */
+ public function listTitles(int $id, int $limit = 0): array {
+ $sql = <<<'SQL'
+ SELECT e.title FROM `_entry` e
+ INNER JOIN `_feed` f ON e.id_feed=f.id
+ WHERE f.category=:id_category
+ ORDER BY e.id DESC
+ SQL;
+ $sql .= ($limit < 1 ? '' : ' LIMIT ' . intval($limit));
+ $res = $this->fetchColumn($sql, 0, [':id_category' => $id]) ?? [];
+ /** @var array<int,string> $res */
+ return $res;
+ }
+
/**
* @param array<array{'c_name':string,'c_id':int,'c_kind':int,'c_last_update':int,'c_error':int|bool,'c_attributes'?:string,
* 'id'?:int,'name'?:string,'url'?:string,'kind'?:int,'website'?:string,'priority'?:int,