summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorBernhard Posselt <nukeawhale@gmail.com>2012-10-13 02:21:36 +0200
committerBernhard Posselt <nukeawhale@gmail.com>2012-10-13 02:21:47 +0200
commitdfcf639f2f7b6eaf82c48dd503f7c98ce9d2155e (patch)
tree603e257c5a60ec7b126b2e8716383d83052e26a8 /lib
parent8fd373e8d5194e315f840fe654b7031979910e88 (diff)
refactored index php into controllers
Diffstat (limited to 'lib')
-rw-r--r--lib/feed.php6
-rw-r--r--lib/feedmapper.php13
-rw-r--r--lib/foldermapper.php8
3 files changed, 21 insertions, 6 deletions
diff --git a/lib/feed.php b/lib/feed.php
index 9a9226d73..4f82404f6 100644
--- a/lib/feed.php
+++ b/lib/feed.php
@@ -12,12 +12,6 @@
namespace OCA\News;
-class FeedType {
- const FEED = 0;
- const FOLDER = 1;
- const STARRED = 2;
- const SUBSCRIPTIONS = 3;
-}
/**
* This class models a feed.
diff --git a/lib/feedmapper.php b/lib/feedmapper.php
index 16804a1a7..35847acdf 100644
--- a/lib/feedmapper.php
+++ b/lib/feedmapper.php
@@ -72,6 +72,19 @@ class FeedMapper {
return $feeds;
}
+
+ /**
+ * @brief returns the number of feeds that a user has
+ * @returns the number of feeds that a user has
+ */
+ public function feedCount() {
+ $query = 'SELECT COUNT(*) AS size FROM ' . self::tableName . ' WHERE user_id = ?';
+ $stmt = \OCP\DB::prepare($query);
+ $result = $stmt->execute(array($this->userid))->fetchRow();
+ return $result['size'];
+ }
+
+
/**
* @brief Retrieve a feed from the database
* @param id The id of the feed in the database table.
diff --git a/lib/foldermapper.php b/lib/foldermapper.php
index 17fcbbf7b..a30759d2d 100644
--- a/lib/foldermapper.php
+++ b/lib/foldermapper.php
@@ -83,6 +83,14 @@ class FolderMapper {
/**
+ * This is being used for consistency
+ */
+ public function findById($id){
+ return $this->find($id);
+ }
+
+
+ /**
* @brief Retrieve a folder from the database
* @param id The id of the folder in the database table.
* @returns an instance of OC_News_Folder