diff options
author | Bernhard Posselt <nukeawhale@gmail.com> | 2013-03-20 19:30:05 +0100 |
---|---|---|
committer | Bernhard Posselt <nukeawhale@gmail.com> | 2013-03-20 19:30:05 +0100 |
commit | c26baa1eb7803f2291612c866d7610679f51f6d6 (patch) | |
tree | fa638a20832c7fac247ceb354b39fdcacc8b0b10 /db | |
parent | 9c78fd8295f8e27cdb8fe8c4e10ffae650bc14d0 (diff) |
finished feedmapper
Diffstat (limited to 'db')
-rw-r--r-- | db/feedmapper.php | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/db/feedmapper.php b/db/feedmapper.php index 2a84574df..a2d0f8fc7 100644 --- a/db/feedmapper.php +++ b/db/feedmapper.php @@ -57,7 +57,7 @@ class FeedMapper extends NewsMapper { $feed = new Feed(); $feed->fromRow($row); array_push($feeds, $feed); - } + } return $feeds; } @@ -78,4 +78,16 @@ class FeedMapper extends NewsMapper { return $this->findAllRows($sql); } + + public function getStarredCount($userId){ + $sql = 'SELECT COUNT(*) AS size FROM `*dbprefix*news_feeds` ' . + 'AND `user_id` = ? ' . + 'AND ((`status` & ?) > 0)'; + $params = array($userId, StatusFlag::STARRED); + + $result = $this->execute($sql, $params)->fetchRow(); + + return $result['size']; + } + }
\ No newline at end of file |