From 464ff6c4c1bda3edbd0f132c4d3d866539d3a117 Mon Sep 17 00:00:00 2001 From: Bernhard Posselt Date: Mon, 15 Apr 2013 16:02:32 +0200 Subject: renamed bl to businesslayer, handle exception in update routine, fix #69 --- controller/itemcontroller.php | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'controller/itemcontroller.php') diff --git a/controller/itemcontroller.php b/controller/itemcontroller.php index c911fa3c6..cfdfc4156 100644 --- a/controller/itemcontroller.php +++ b/controller/itemcontroller.php @@ -29,16 +29,17 @@ use \OCA\AppFramework\Controller\Controller; use \OCA\AppFramework\Core\API; use \OCA\AppFramework\Http\Request; -use \OCA\News\Bl\ItemBl; +use \OCA\News\BusinessLayer\ItemBusinessLayer; class ItemController extends Controller { - private $itemBl; + private $itemBusinessLayer; - public function __construct(API $api, Request $request, ItemBl $itemBl){ + public function __construct(API $api, Request $request, + ItemBusinessLayer $itemBusinessLayer){ parent::__construct($api, $request); - $this->itemBl = $itemBl; + $this->itemBusinessLayer = $itemBusinessLayer; } @@ -60,11 +61,11 @@ class ItemController extends Controller { if($limit !== null){ $offset = (int) $this->params('offset', 0); - $items = $this->itemBl->findAll($id, $type, (int) $limit, $offset, + $items = $this->itemBusinessLayer->findAll($id, $type, (int) $limit, $offset, $showAll, $userId); } else { $updatedSince = (int) $this->params('updatedSince'); - $items = $this->itemBl->findAllNew($id, $type, $updatedSince, + $items = $this->itemBusinessLayer->findAllNew($id, $type, $updatedSince, $showAll, $userId); } @@ -83,7 +84,7 @@ class ItemController extends Controller { */ public function starred(){ $userId = $this->api->getUserId(); - $starredCount = $this->itemBl->starredCount($userId); + $starredCount = $this->itemBusinessLayer->starredCount($userId); $params = array( 'starred' => (int) $starredCount @@ -98,7 +99,7 @@ class ItemController extends Controller { $feedId = (int) $this->params('feedId'); $guidHash = $this->params('guidHash'); - $this->itemBl->star($feedId, $guidHash, $isStarred, $userId); + $this->itemBusinessLayer->star($feedId, $guidHash, $isStarred, $userId); } @@ -130,7 +131,7 @@ class ItemController extends Controller { $userId = $this->api->getUserId(); $itemId = (int) $this->params('itemId'); - $this->itemBl->read($itemId, $isRead, $userId); + $this->itemBusinessLayer->read($itemId, $isRead, $userId); } /** @@ -167,7 +168,7 @@ class ItemController extends Controller { $feedId = (int) $this->params('feedId'); $highestItemId = (int) $this->params('highestItemId'); - $this->itemBl->readFeed($feedId, $highestItemId, $userId); + $this->itemBusinessLayer->readFeed($feedId, $highestItemId, $userId); return $this->renderJSON(); } -- cgit v1.2.3