aboutsummaryrefslogtreecommitdiff
path: root/app/Models/EntryDAOSQLite.php
diff options
context:
space:
mode:
authorGravatar Alexis Degrugillier <github@ainw.org> 2014-12-06 10:15:34 -0500
committerGravatar Alexis Degrugillier <github@ainw.org> 2014-12-06 10:27:45 -0500
commiteaaf8cdbf1e87ad22d25257eb99a4b80b579e661 (patch)
tree8177b0f3f6f09d2d5e8e75ea2730b0eccfdfebe5 /app/Models/EntryDAOSQLite.php
parent6a706c95df557d1897608c89d3f5e0d0e9cd20ac (diff)
Add comments
Diffstat (limited to 'app/Models/EntryDAOSQLite.php')
-rw-r--r--app/Models/EntryDAOSQLite.php45
1 files changed, 45 insertions, 0 deletions
diff --git a/app/Models/EntryDAOSQLite.php b/app/Models/EntryDAOSQLite.php
index 4a3fe24a2..bb1539e0c 100644
--- a/app/Models/EntryDAOSQLite.php
+++ b/app/Models/EntryDAOSQLite.php
@@ -31,6 +31,19 @@ class FreshRSS_EntryDAOSQLite extends FreshRSS_EntryDAO {
}
}
+ /**
+ * Toggle the read marker on one or more article.
+ * Then the cache is updated.
+ *
+ * @todo change the way the query is build because it seems there is
+ * unnecessary code in here. For instance, the part with the str_repeat.
+ * @todo remove code duplication. It seems the code is basically the
+ * same if it is an array or not.
+ *
+ * @param integer|array $ids
+ * @param boolean $is_read
+ * @return integer affected rows
+ */
public function markRead($ids, $is_read = true) {
if (is_array($ids)) { //Many IDs at once (used by API)
if (true) { //Speed heuristics //TODO: Not implemented yet for SQLite (so always call IDs one by one)
@@ -69,6 +82,27 @@ class FreshRSS_EntryDAOSQLite extends FreshRSS_EntryDAO {
}
}
+ /**
+ * Mark all entries as read depending on parameters.
+ * If $onlyFavorites is true, it is used when the user mark as read in
+ * the favorite pseudo-category.
+ * If $priorityMin is greater than 0, it is used when the user mark as
+ * read in the main feed pseudo-category.
+ * Then the cache is updated.
+ *
+ * If $idMax equals 0, a deprecated debug message is logged
+ *
+ * @todo refactor this method along with markReadCat and markReadFeed
+ * since they are all doing the same thing. I think we need to build a
+ * tool to generate the query instead of having queries all over the
+ * place. It will be reused also for the filtering making every thing
+ * separated.
+ *
+ * @param integer $idMax fail safe article ID
+ * @param boolean $onlyFavorites
+ * @param integer $priorityMin
+ * @return integer affected rows
+ */
public function markReadEntries($idMax = 0, $onlyFavorites = false, $priorityMin = 0) {
if ($idMax == 0) {
$idMax = time() . '000000';
@@ -95,6 +129,17 @@ class FreshRSS_EntryDAOSQLite extends FreshRSS_EntryDAO {
return $affected;
}
+ /**
+ * Mark all the articles in a category as read.
+ * There is a fail safe to prevent to mark as read articles that are
+ * loaded during the mark as read action. Then the cache is updated.
+ *
+ * If $idMax equals 0, a deprecated debug message is logged
+ *
+ * @param integer $id category ID
+ * @param integer $idMax fail safe article ID
+ * @return integer affected rows
+ */
public function markReadCat($id, $idMax = 0) {
if ($idMax == 0) {
$idMax = time() . '000000';