From 2b4da592f1c8a2210f9ba49a9e24eb2056e5d4a8 Mon Sep 17 00:00:00 2001 From: Bernhard Posselt Date: Thu, 22 May 2014 02:15:56 +0200 Subject: simplify star and read --- db/item.php | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) (limited to 'db') diff --git a/db/item.php b/db/item.php index e7cbb7793..08c01932f 100644 --- a/db/item.php +++ b/db/item.php @@ -109,21 +109,22 @@ class Item extends Entity implements IAPI, \JsonSerializable { * Turns entitie attributes into an array */ public function jsonSerialize() { - return $this->serializeFields([ - 'id', - 'guidHash', - 'guid', - 'url', - 'title', - 'author', - 'pubDate', - 'body', - 'enclosureMime', - 'enclosureLink', - 'feedId', - 'status', - 'lastModified', - ]); + return [ + 'id' => $this->getId(), + 'guid' => $this->getGuid(), + 'guidHash' => $this->getGuidHash(), + 'url' => $this->getUrl(), + 'title' => $this->getTitle(), + 'author' => $this->getAuthor(), + 'pubDate' => $this->getPubDate(), + 'body' => $this->getBody(), + 'enclosureMime' => $this->getEnclosureMime(), + 'enclosureLink' => $this->getEnclosureLink(), + 'feedId' => $this->getFeedId(), + 'unread' => $this->isUnread(), + 'starred' => $this->isStarred(), + 'lastModified' => $this->getLastModified() + ]; } public function toAPI() { @@ -183,7 +184,7 @@ class Item extends Entity implements IAPI, \JsonSerializable { } else { $item->setUnstarred(); } - + return $item; } -- cgit v1.2.3