From 79032a17fb1f458aae723098ddc1a96c28daad05 Mon Sep 17 00:00:00 2001 From: Bernhard Posselt Date: Fri, 30 May 2014 00:06:49 +0200 Subject: add autopaging --- controller/itemcontroller.php | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'controller') diff --git a/controller/itemcontroller.php b/controller/itemcontroller.php index 4f3f22c62..30677d9fc 100644 --- a/controller/itemcontroller.php +++ b/controller/itemcontroller.php @@ -54,7 +54,7 @@ class ItemController extends Controller { * @param int $limit * @param int $offset */ - public function index($type, $id, $limit, $offset=0) { + public function index($type, $id, $limit=50, $offset=0) { $showAll = $this->settings->getUserValue($this->userId, $this->appName, 'showAll') === '1'; $oldestFirst = $this->settings->getUserValue($this->userId, $this->appName, @@ -163,4 +163,20 @@ class ItemController extends Controller { } + /** + * @NoAdminRequired + * + * @param int[] item ids + */ + public function readMultiple($itemIds) { + foreach($itemIds as $id) { + try { + $this->itemService->read($id, true, $this->userId); + } catch(ServiceNotFoundException $ex) { + continue; + } + } + } + + } \ No newline at end of file -- cgit v1.2.3