From c8bdd9c3fb0ab872b868c151f052748235601653 Mon Sep 17 00:00:00 2001 From: Bernhard Posselt Date: Thu, 21 Mar 2013 20:38:09 +0100 Subject: finished feedcontroller --- bl/itembl.php | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) (limited to 'bl/itembl.php') diff --git a/bl/itembl.php b/bl/itembl.php index 7dee2318f..f2b1ac1b3 100644 --- a/bl/itembl.php +++ b/bl/itembl.php @@ -37,22 +37,39 @@ class ItemBl extends Bl { public function findAll(){ - + // TODO all the crazy finding of items } - public function finStarred(){ + public function starredCount($userId){ + return $this->mapper->starredCount($userId); + } + + public function star($itemId, $isStarred, $userId){ + $item = $this->find($itemId, $userId); + if($isStarred){ + $item->setStarred(); + } else { + $item->setUnstarred(); + } + $this->mapper->update($item); } - public function star(){ - + public function read($itemId, $isRead, $userId){ + $item = $this->find($itemId, $userId); + if($isRead){ + $item->setRead(); + } else { + $item->setUnread(); + } + $this->mapper->update($item); } - public function read(){ - + public function readFeed($feedId, $userId){ + $this->mapper->readFeed($feedId, $userId); } } -- cgit v1.2.3