summaryrefslogtreecommitdiffstats
path: root/db
diff options
context:
space:
mode:
authorBernhard Posselt <dev@bernhard-posselt.com>2014-05-22 02:15:56 +0200
committerBernhard Posselt <dev@bernhard-posselt.com>2014-05-22 02:15:56 +0200
commit2b4da592f1c8a2210f9ba49a9e24eb2056e5d4a8 (patch)
treea75d63fcfbe307bd22bef14f8befaa9545c8f544 /db
parentf0aae6875bc1da724d1960805f88b4b707742a44 (diff)
simplify star and read
Diffstat (limited to 'db')
-rw-r--r--db/item.php33
1 files changed, 17 insertions, 16 deletions
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;
}