diff options
author | Bernhard Posselt <nukeawhale@gmail.com> | 2013-04-29 13:25:04 +0200 |
---|---|---|
committer | Bernhard Posselt <nukeawhale@gmail.com> | 2013-04-29 13:30:01 +0200 |
commit | 3fc18156ae0b586e8de0c82949acfa6291317536 (patch) | |
tree | 201e97511bea44c58b5e9d78d8cf36ae2e2b54f9 /businesslayer/itembusinesslayer.php | |
parent | a03b54c6a59837d0045c140ea7aef3fae95daa95 (diff) |
go back to order by id, fix #138, use a newest item id to prevent marking items as read that the user didnt see yet fix #141, also update the starred count periodically
Diffstat (limited to 'businesslayer/itembusinesslayer.php')
-rw-r--r-- | businesslayer/itembusinesslayer.php | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/businesslayer/itembusinesslayer.php b/businesslayer/itembusinesslayer.php index 794da73b7..72323f413 100644 --- a/businesslayer/itembusinesslayer.php +++ b/businesslayer/itembusinesslayer.php @@ -49,8 +49,8 @@ class ItemBusinessLayer extends BusinessLayer { } - public function findAllNew($id, $type, $updatedSince, - $showAll, $userId){ + public function findAllNew($id, $type, $updatedSince, $showAll, $userId){ + $status = $this->statusFlag->typeToStatus($type, $showAll); switch($type){ @@ -71,36 +71,28 @@ class ItemBusinessLayer extends BusinessLayer { } - public function findAll($id, $type, $limit, $offset, $newestItemId, $showAll, - $userId){ - + public function findAll($id, $type, $limit, $offset, + $showAll, $userId){ $status = $this->statusFlag->typeToStatus($type, $showAll); switch($type){ case FeedType::FEED: $items = $this->mapper->findAllFeed($id, $limit, $offset, - $newestItemId, $status, - $userId); + $status, $userId); break; case FeedType::FOLDER: $items = $this->mapper->findAllFolder($id, $limit, $offset, - $newestItemId, $status, - $userId); + $status, $userId); break; default: - $items = $this->mapper->findAll($limit, $offset, $newestItemId, - $status, $userId); + $items = $this->mapper->findAll($limit, $offset, $status, + $userId); } return $items; } - public function starredCount($userId){ - return $this->mapper->starredCount($userId); - } - - public function star($feedId, $guidHash, $isStarred, $userId){ // FIXME: this can throw two possible exceptions $item = $this->mapper->findByGuidHash($guidHash, $feedId, $userId); @@ -151,4 +143,8 @@ class ItemBusinessLayer extends BusinessLayer { } + public function starredCount($userId){ + return $this->mapper->starredCount($userId); + } + } |