From acc2df1251a1c1b9ec5ede13bdf46d516dc64b0d Mon Sep 17 00:00:00 2001 From: Bernhard Posselt Date: Wed, 14 May 2014 02:16:31 +0200 Subject: use more flexible serializer that ignores nulls, non entity values and responses --- controller/itemapicontroller.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'controller/itemapicontroller.php') diff --git a/controller/itemapicontroller.php b/controller/itemapicontroller.php index 9e4fb672c..8110c3ab0 100644 --- a/controller/itemapicontroller.php +++ b/controller/itemapicontroller.php @@ -34,6 +34,7 @@ class ItemApiController extends ApiController { parent::__construct($appName, $request); $this->itemBusinessLayer = $itemBusinessLayer; $this->userId = $userId; + $this->registerSerializer(new EntityApiSerializer('items')); } @@ -49,8 +50,6 @@ class ItemApiController extends ApiController { * @param int $offset */ public function index($type, $id, $getRead, $batchSize=20, $offset=0) { - $this->registerSerializer(new EntityApiSerializer('items')); - return $this->itemBusinessLayer->findAll($id, $type, $batchSize, $offset, $getRead, $this->userId); } @@ -66,8 +65,6 @@ class ItemApiController extends ApiController { * @param int $lastModified */ public function updated($type, $id, $lastModified=0) { - $this->registerSerializer(new EntityApiSerializer('items')); - return $this->itemBusinessLayer->findAllNew($id, $type, $lastModified, true, $this->userId); } -- cgit v1.2.3