diff options
author | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-05-29 22:58:30 +0200 |
---|---|---|
committer | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-05-29 22:58:30 +0200 |
commit | cba949fb0771c832326fc7886cced2bdc37e7536 (patch) | |
tree | 9e1a335a83a6006f645c801b762db7525e4c6c59 /controller/feedapicontroller.php | |
parent | b91ef01fdbf14c6a5d58e5c471dbb1fc9d17cdfb (diff) |
order by pubdate
Diffstat (limited to 'controller/feedapicontroller.php')
-rw-r--r-- | controller/feedapicontroller.php | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/controller/feedapicontroller.php b/controller/feedapicontroller.php index c6b5b6866..4ba3b9be5 100644 --- a/controller/feedapicontroller.php +++ b/controller/feedapicontroller.php @@ -33,6 +33,7 @@ class FeedApiController extends ApiController { private $userId; private $logger; private $loggerParams; + private $serializer; public function __construct($appName, IRequest $request, @@ -47,7 +48,7 @@ class FeedApiController extends ApiController { $this->userId = $userId; $this->logger = $logger; $this->loggerParams = $loggerParams; - $this->registerSerializer(new EntityApiSerializer('feeds')); + $this->serializer = new EntityApiSerializer('feeds'); } @@ -64,14 +65,14 @@ class FeedApiController extends ApiController { 'feeds' => $this->feedService->findAll($this->userId) ]; - + try { $result['newestItemId'] = $this->itemService->getNewestItemId($this->userId); - + // in case there are no items, ignore } catch(ServiceNotFoundException $ex) {} - return $result; + return $this->serializer->serialize($result); } @@ -96,7 +97,7 @@ class FeedApiController extends ApiController { // in case there are no items, ignore } catch(ServiceNotFoundException $ex) {} - return $result; + return $this->serializer->serialize($result); } catch(ServiceConflictException $ex) { return $this->error($ex, Http::STATUS_CONFLICT); @@ -110,7 +111,7 @@ class FeedApiController extends ApiController { * @NoAdminRequired * @NoCSRFRequired * @CORS - * + * * @param int $feedId */ public function delete($feedId) { @@ -179,7 +180,7 @@ class FeedApiController extends ApiController { foreach ($feeds as $feed) { $result['feeds'][] = [ - 'id' => $feed->getId(), + 'id' => $feed->getId(), 'userId' => $feed->getUserId() ]; } |