summaryrefslogtreecommitdiff
path: root/app/Models/EntryDAO.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/Models/EntryDAO.php')
-rw-r--r--app/Models/EntryDAO.php82
1 files changed, 41 insertions, 41 deletions
diff --git a/app/Models/EntryDAO.php b/app/Models/EntryDAO.php
index ba0cf1970..cd8373766 100644
--- a/app/Models/EntryDAO.php
+++ b/app/Models/EntryDAO.php
@@ -312,7 +312,7 @@ SQL;
}
$sql = 'UPDATE `_entry` '
. 'SET is_favorite=? '
- . 'WHERE id IN (' . str_repeat('?,', count($ids) - 1). '?)';
+ . 'WHERE id IN (' . str_repeat('?,', count($ids) - 1) . '?)';
$values = [$is_favorite ? 1 : 0];
$values = array_merge($values, $ids);
$stm = $this->pdo->prepare($sql);
@@ -393,7 +393,7 @@ SQL;
$sql = 'UPDATE `_entry` '
. 'SET is_read=? '
- . 'WHERE id IN (' . str_repeat('?,', count($ids) - 1). '?)';
+ . 'WHERE id IN (' . str_repeat('?,', count($ids) - 1) . '?)';
$values = [$is_read ? 1 : 0];
$values = array_merge($values, $ids);
$stm = $this->pdo->prepare($sql);
@@ -1062,43 +1062,43 @@ SQL;
$where = '';
$values = [];
switch ($type) {
- case 'a': //All PRIORITY_MAIN_STREAM
- $where .= 'f.priority >= ' . FreshRSS_Feed::PRIORITY_MAIN_STREAM . ' ';
- break;
- case 'A': //All except PRIORITY_ARCHIVED
- $where .= 'f.priority > ' . FreshRSS_Feed::PRIORITY_ARCHIVED . ' ';
- break;
- case 'i': //Priority important feeds
- $where .= 'f.priority >= ' . FreshRSS_Feed::PRIORITY_IMPORTANT . ' ';
- break;
- case 's': //Starred. Deprecated: use $state instead
- $where .= 'f.priority > ' . FreshRSS_Feed::PRIORITY_ARCHIVED . ' ';
- $where .= 'AND e.is_favorite=1 ';
- break;
- case 'S': //Starred
- $where .= 'e.is_favorite=1 ';
- break;
- case 'c': //Category
- $where .= 'f.priority >= ' . FreshRSS_Feed::PRIORITY_CATEGORY . ' ';
- $where .= 'AND f.category=? ';
- $values[] = $id;
- break;
- case 'f': //Feed
- $where .= 'e.id_feed=? ';
- $values[] = $id;
- break;
- case 't': //Tag (label)
- $where .= 'et.id_tag=? ';
- $values[] = $id;
- break;
- case 'T': //Any tag (label)
- $where .= '1=1 ';
- break;
- case 'ST': //Starred or tagged (label)
- $where .= 'e.is_favorite=1 OR EXISTS (SELECT et2.id_tag FROM `_entrytag` et2 WHERE et2.id_entry = e.id) ';
- break;
- default:
- throw new FreshRSS_EntriesGetter_Exception('Bad type in Entry->listByType: [' . $type . ']!');
+ case 'a': //All PRIORITY_MAIN_STREAM
+ $where .= 'f.priority >= ' . FreshRSS_Feed::PRIORITY_MAIN_STREAM . ' ';
+ break;
+ case 'A': //All except PRIORITY_ARCHIVED
+ $where .= 'f.priority > ' . FreshRSS_Feed::PRIORITY_ARCHIVED . ' ';
+ break;
+ case 'i': //Priority important feeds
+ $where .= 'f.priority >= ' . FreshRSS_Feed::PRIORITY_IMPORTANT . ' ';
+ break;
+ case 's': //Starred. Deprecated: use $state instead
+ $where .= 'f.priority > ' . FreshRSS_Feed::PRIORITY_ARCHIVED . ' ';
+ $where .= 'AND e.is_favorite=1 ';
+ break;
+ case 'S': //Starred
+ $where .= 'e.is_favorite=1 ';
+ break;
+ case 'c': //Category
+ $where .= 'f.priority >= ' . FreshRSS_Feed::PRIORITY_CATEGORY . ' ';
+ $where .= 'AND f.category=? ';
+ $values[] = $id;
+ break;
+ case 'f': //Feed
+ $where .= 'e.id_feed=? ';
+ $values[] = $id;
+ break;
+ case 't': //Tag (label)
+ $where .= 'et.id_tag=? ';
+ $values[] = $id;
+ break;
+ case 'T': //Any tag (label)
+ $where .= '1=1 ';
+ break;
+ case 'ST': //Starred or tagged (label)
+ $where .= 'e.is_favorite=1 OR EXISTS (SELECT et2.id_tag FROM `_entrytag` et2 WHERE et2.id_entry = e.id) ';
+ break;
+ default:
+ throw new FreshRSS_EntriesGetter_Exception('Bad type in Entry->listByType: [' . $type . ']!');
}
[$searchValues, $search] = $this->sqlListEntriesWhere('e.', $filters, $state, $order, $firstId, $date_min);
@@ -1257,7 +1257,7 @@ SQL;
}
$guids = array_unique($guids);
$sql = 'SELECT guid, ' . static::sqlHexEncode('hash') .
- ' AS hex_hash FROM `_entry` WHERE id_feed=? AND guid IN (' . str_repeat('?,', count($guids) - 1). '?)';
+ ' AS hex_hash FROM `_entry` WHERE id_feed=? AND guid IN (' . str_repeat('?,', count($guids) - 1) . '?)';
$stm = $this->pdo->prepare($sql);
$values = [$id_feed];
$values = array_merge($values, $guids);
@@ -1294,7 +1294,7 @@ SQL;
}
return $affected;
}
- $sql = 'UPDATE `_entry` SET `lastSeen`=? WHERE id_feed=? AND guid IN (' . str_repeat('?,', count($guids) - 1). '?)';
+ $sql = 'UPDATE `_entry` SET `lastSeen`=? WHERE id_feed=? AND guid IN (' . str_repeat('?,', count($guids) - 1) . '?)';
$stm = $this->pdo->prepare($sql);
if ($mtime <= 0) {
$mtime = time();