From 3fc18156ae0b586e8de0c82949acfa6291317536 Mon Sep 17 00:00:00 2001 From: Bernhard Posselt Date: Mon, 29 Apr 2013 13:25:04 +0200 Subject: 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 --- businesslayer/itembusinesslayer.php | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) (limited to 'businesslayer/itembusinesslayer.php') 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); + } + } -- cgit v1.2.3