aboutsummaryrefslogtreecommitdiff
path: root/app/Models/CategoryDAO.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2023-12-15 23:04:29 +0100
committerGravatar GitHub <noreply@github.com> 2023-12-15 23:04:29 +0100
commit6bb45a87268157aab961a6a4a728d9a9bbe043b0 (patch)
treed1c36638d5ee61e2e663d214d724a71f07a89354 /app/Models/CategoryDAO.php
parenta3ed8269132303eebc03d3e6df822f1f101fa95b (diff)
Add filter actions (auto mark read) at category and global levels (#5942)
* Add filter actions (auto mark read) at category level fix https://github.com/FreshRSS/FreshRSS/issues/3497 * Add filter actions (auto mark read) at global level fix https://github.com/FreshRSS/FreshRSS/issues/2788 * Fix feed category ID * Minor comment
Diffstat (limited to 'app/Models/CategoryDAO.php')
-rw-r--r--app/Models/CategoryDAO.php11
1 files changed, 5 insertions, 6 deletions
diff --git a/app/Models/CategoryDAO.php b/app/Models/CategoryDAO.php
index 2477d0ea2..20347e4f2 100644
--- a/app/Models/CategoryDAO.php
+++ b/app/Models/CategoryDAO.php
@@ -351,8 +351,7 @@ SQL;
$def_cat = $this->searchById(self::DEFAULTCATEGORYID);
if ($def_cat == null) {
- $cat = new FreshRSS_Category(_t('gen.short.default_category'));
- $cat->_id(self::DEFAULTCATEGORYID);
+ $cat = new FreshRSS_Category(_t('gen.short.default_category'), self::DEFAULTCATEGORYID);
$sql = 'INSERT INTO `_category`(id, name) VALUES(?, ?)';
if ($this->pdo->dbType() === 'pgsql') {
@@ -441,9 +440,9 @@ SQL;
// End of the current category, we add it to the $list
$cat = new FreshRSS_Category(
$previousLine['c_name'],
+ $previousLine['c_id'],
$feedDao::daoToFeed($feedsDao, $previousLine['c_id'])
);
- $cat->_id($previousLine['c_id']);
$cat->_kind($previousLine['c_kind']);
$cat->_attributes('', $previousLine['c_attributes'] ?? '[]');
$list[(int)$previousLine['c_id']] = $cat;
@@ -459,9 +458,9 @@ SQL;
if ($previousLine != null) {
$cat = new FreshRSS_Category(
$previousLine['c_name'],
+ $previousLine['c_id'],
$feedDao::daoToFeed($feedsDao, $previousLine['c_id'])
);
- $cat->_id($previousLine['c_id']);
$cat->_kind($previousLine['c_kind']);
$cat->_lastUpdate($previousLine['c_last_update'] ?? 0);
$cat->_error($previousLine['c_error'] ?? 0);
@@ -482,9 +481,9 @@ SQL;
foreach ($listDAO as $dao) {
FreshRSS_DatabaseDAO::pdoInt($dao, ['id', 'kind', 'lastUpdate', 'error']);
$cat = new FreshRSS_Category(
- $dao['name']
+ $dao['name'],
+ $dao['id']
);
- $cat->_id($dao['id']);
$cat->_kind($dao['kind']);
$cat->_lastUpdate($dao['lastUpdate'] ?? 0);
$cat->_error($dao['error'] ?? 0);