diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/feed.php | 6 | ||||
-rw-r--r-- | lib/feedmapper.php | 13 | ||||
-rw-r--r-- | lib/foldermapper.php | 8 |
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 |