diff options
Diffstat (limited to 'controller')
-rw-r--r-- | controller/itemcontroller.php | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/controller/itemcontroller.php b/controller/itemcontroller.php index 1dbf7c43e..7a9fb1aeb 100644 --- a/controller/itemcontroller.php +++ b/controller/itemcontroller.php @@ -48,7 +48,24 @@ class ItemController extends Controller { * @Ajax */ public function items(){ - // TBD + $userId = $this->api->getUserId(); + $limit = $this->params('limit'); + $type = $this->params('type'); + $id = $this->params('id'); + + if($limit !== null){ + $offset = $this->params('offset', 0); + $items = $this->itemBl->findAll($id, $type, $limit, $offset, $userId); + } else { + $updatedSince = $this->params('updatedSince'); + $items = $this->itemBl->findAllNew($id, $type, $updatedSince, $userId); + } + + $params = array( + 'items' => $items + ); + + return $this->renderJSON($params); } |