aboutsummaryrefslogtreecommitdiff
path: root/app/models/Entry.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/Entry.php')
-rwxr-xr-xapp/models/Entry.php27
1 files changed, 27 insertions, 0 deletions
diff --git a/app/models/Entry.php b/app/models/Entry.php
index 245fea2f6..71ace9b5e 100755
--- a/app/models/Entry.php
+++ b/app/models/Entry.php
@@ -443,6 +443,33 @@ class EntryDAO extends Model_pdo {
return $res[0]['count'];
}
+ public function countNotReadByFeed ($id) {
+ $sql = 'SELECT COUNT(*) AS count FROM entry WHERE is_read = 0 AND id_feed = ?';
+ $stm = $this->bd->prepare ($sql);
+ $stm->execute (array ($id));
+ $res = $stm->fetchAll (PDO::FETCH_ASSOC);
+
+ return $res[0]['count'];
+ }
+
+ public function countNotReadByCat ($id) {
+ $sql = 'SELECT COUNT(*) AS count FROM entry e INNER JOIN feed f ON e.id_feed = f.id WHERE is_read=0 AND category = ?';
+ $stm = $this->bd->prepare ($sql);
+ $stm->execute (array ($id));
+ $res = $stm->fetchAll (PDO::FETCH_ASSOC);
+
+ return $res[0]['count'];
+ }
+
+ public function countNotReadFavorites () {
+ $sql = 'SELECT COUNT(*) AS count FROM entry WHERE is_read=0 AND is_favorite=1';
+ $stm = $this->bd->prepare ($sql);
+ $stm->execute ();
+ $res = $stm->fetchAll (PDO::FETCH_ASSOC);
+
+ return $res[0]['count'];
+ }
+
public function countFavorites () {
$sql = 'SELECT COUNT(*) AS count FROM entry WHERE is_favorite=1';
$stm = $this->bd->prepare ($sql);