aboutsummaryrefslogtreecommitdiff
path: root/app/Models/EntryDAO.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/Models/EntryDAO.php')
-rw-r--r--app/Models/EntryDAO.php32
1 files changed, 18 insertions, 14 deletions
diff --git a/app/Models/EntryDAO.php b/app/Models/EntryDAO.php
index 6d00967fc..2f5a9e1f6 100644
--- a/app/Models/EntryDAO.php
+++ b/app/Models/EntryDAO.php
@@ -415,9 +415,6 @@ class FreshRSS_EntryDAO extends Minz_ModelPdo {
$where .= 'f.priority > 0 ';
$joinFeed = true;
break;
- case 's':
- $where .= 'e1.is_favorite = 1 ';
- break;
case 'c':
$where .= 'f.category = ? ';
$values[] = intval($id);
@@ -433,21 +430,28 @@ class FreshRSS_EntryDAO extends Minz_ModelPdo {
default:
throw new FreshRSS_EntriesGetter_Exception ('Bad type in Entry->listByType: [' . $type . ']!');
}
- switch ($state) {
- case 'all':
- break;
- case 'not_read':
+
+ if ($state & FreshRSS_Configuration::STATE_NOT_READ) {
+ if (!($state & FreshRSS_Configuration::STATE_READ)) {
$where .= 'AND e1.is_read = 0 ';
- break;
- case 'read':
+ }
+ }
+ if ($state & FreshRSS_Configuration::STATE_READ) {
+ if (!($state & FreshRSS_Configuration::STATE_NOT_READ)) {
$where .= 'AND e1.is_read = 1 ';
- break;
- case 'favorite':
+ }
+ }
+ if ($state & FreshRSS_Configuration::STATE_NOT_FAVORITE) {
+ if (!($state & FreshRSS_Configuration::STATE_FAVORITE)) {
+ $where .= 'AND e1.is_favorite = 0 ';
+ }
+ }
+ if ($state & FreshRSS_Configuration::STATE_FAVORITE) {
+ if (!($state & FreshRSS_Configuration::STATE_NOT_FAVORITE)) {
$where .= 'AND e1.is_favorite = 1 ';
- break;
- default:
- throw new FreshRSS_EntriesGetter_Exception ('Bad state in Entry->listByType: [' . $state . ']!');
+ }
}
+
switch ($order) {
case 'DESC':
case 'ASC':