diff options
author | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-05-30 00:06:49 +0200 |
---|---|---|
committer | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-05-30 00:06:49 +0200 |
commit | 79032a17fb1f458aae723098ddc1a96c28daad05 (patch) | |
tree | b7e7a7f99e6e334d9058de7445280da6624ec3e3 /controller | |
parent | 320304c909dc12c14b53335a7f32550809c06178 (diff) |
add autopaging
Diffstat (limited to 'controller')
-rw-r--r-- | controller/itemcontroller.php | 18 |
1 files changed, 17 insertions, 1 deletions
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 |