aboutsummaryrefslogtreecommitdiff
path: root/app/Models/FeedDAO.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2014-03-01 15:47:15 +0100
committerGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2014-03-01 15:47:15 +0100
commit71f7ce1be5833b54b0f4e1f37e6557425c364725 (patch)
tree60ea14f1b08fc2df3a761ab8e42b57b87c837892 /app/Models/FeedDAO.php
parent29b3bbfe284a6e56413a2e89b740ffc4172c6847 (diff)
API: SQL optimisation
https://github.com/marienfressinaud/FreshRSS/issues/13
Diffstat (limited to 'app/Models/FeedDAO.php')
-rw-r--r--app/Models/FeedDAO.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/app/Models/FeedDAO.php b/app/Models/FeedDAO.php
index fb4a847a0..f9e1ad9e8 100644
--- a/app/Models/FeedDAO.php
+++ b/app/Models/FeedDAO.php
@@ -242,6 +242,7 @@ class FreshRSS_FeedDAO extends Minz_ModelPdo {
return $res[0]['count'];
}
+
public function countNotRead ($id) {
$sql = 'SELECT COUNT(*) AS count FROM `' . $this->prefix . 'entry` WHERE id_feed=? AND is_read=0';
$stm = $this->bd->prepare ($sql);
@@ -251,6 +252,7 @@ class FreshRSS_FeedDAO extends Minz_ModelPdo {
return $res[0]['count'];
}
+
public function updateCachedValues () { //For one single feed, call updateLastUpdate($id)
$sql = 'UPDATE `' . $this->prefix . 'feed` f '
. 'INNER JOIN ('
@@ -263,9 +265,7 @@ class FreshRSS_FeedDAO extends Minz_ModelPdo {
. 'SET f.cache_nbEntries=x.nbEntries, f.cache_nbUnreads=x.nbUnreads';
$stm = $this->bd->prepare ($sql);
- $values = array ($feed_id);
-
- if ($stm && $stm->execute ($values)) {
+ if ($stm && $stm->execute()) {
return $stm->rowCount();
} else {
$info = $stm->errorInfo();