summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTilo Spannagel <development@tilosp.de>2020-10-09 11:17:44 +0000
committerSean Molenaar <SMillerDev@users.noreply.github.com>2020-10-09 13:59:23 +0200
commita74491ecdefb022c3cd9712ae46bff7a71c8eade (patch)
tree9594db890cdfed05e40259d1211e065345fc0c4f
parentc6cef6c4accf633ca526ded6f5ad2ad47edd4716 (diff)
Add Type Info to Entities
Signed-off-by: Tilo Spannagel <development@tilosp.de>
-rw-r--r--lib/Db/Feed.php27
-rw-r--r--lib/Db/Folder.php10
-rw-r--r--lib/Db/Item.php25
3 files changed, 62 insertions, 0 deletions
diff --git a/lib/Db/Feed.php b/lib/Db/Feed.php
index 9af2f7dc2..80d425117 100644
--- a/lib/Db/Feed.php
+++ b/lib/Db/Feed.php
@@ -76,6 +76,33 @@ class Feed extends Entity implements IAPI, \JsonSerializable
/** @var Item[] */
public $items = [];
+ public function __construct()
+ {
+ $this->addType('userId', 'string');
+ $this->addType('urlHash', 'string');
+ $this->addType('url', 'string');
+ $this->addType('title', 'string');
+ $this->addType('faviconLink', 'string');
+ $this->addType('added', 'integer');
+ $this->addType('folderId', 'integer');
+ $this->addType('link', 'string');
+ $this->addType('preventUpdate', 'boolean');
+ $this->addType('deletedAt', 'integer');
+ $this->addType('articlesPerUpdate', 'integer');
+ $this->addType('httpLastModified', 'string');
+ $this->addType('lastModified', 'string');
+ $this->addType('httpEtag', 'string');
+ $this->addType('location', 'string');
+ $this->addType('ordering', 'integer');
+ $this->addType('fullTextEnabled', 'boolean');
+ $this->addType('pinned', 'boolean');
+ $this->addType('updateMode', 'integer');
+ $this->addType('updateErrorCount', 'integer');
+ $this->addType('lastUpdateError', 'string');
+ $this->addType('basicAuthUser', 'string');
+ $this->addType('basicAuthPassword', 'string');
+ }
+
/**
* @return int|null
*/
diff --git a/lib/Db/Folder.php b/lib/Db/Folder.php
index ec9d27477..e4dbf0fe7 100644
--- a/lib/Db/Folder.php
+++ b/lib/Db/Folder.php
@@ -34,6 +34,16 @@ class Folder extends Entity implements IAPI, \JsonSerializable
/** @var Feed[] */
public $feeds = [];
+ public function __construct()
+ {
+ $this->addType('parentId', 'integer');
+ $this->addType('name', 'string');
+ $this->addType('userId', 'string');
+ $this->addType('opened', 'boolean');
+ $this->addType('deletedAt', 'integer');
+ $this->addType('lastModified', 'string');
+ }
+
/**
* @return int|null
*/
diff --git a/lib/Db/Item.php b/lib/Db/Item.php
index 1619358ed..555bcbb61 100644
--- a/lib/Db/Item.php
+++ b/lib/Db/Item.php
@@ -68,6 +68,31 @@ class Item extends Entity implements IAPI, \JsonSerializable
/** @var bool */
protected $starred = false;
+ public function __construct()
+ {
+ $this->addType('contentHash', 'string');
+ $this->addType('guidHash', 'string');
+ $this->addType('guid', 'string');
+ $this->addType('url', 'string');
+ $this->addType('title', 'string');
+ $this->addType('author', 'string');
+ $this->addType('pubDate', 'integer');
+ $this->addType('updatedDate', 'integer');
+ $this->addType('body', 'string');
+ $this->addType('enclosureMime', 'string');
+ $this->addType('enclosureLink', 'string');
+ $this->addType('mediaThumbnail', 'string');
+ $this->addType('mediaDescription', 'string');
+ $this->addType('feedId', 'integer');
+ $this->addType('status', 'integer');
+ $this->addType('lastModified', 'string');
+ $this->addType('searchIndex', 'string');
+ $this->addType('rtl', 'boolean');
+ $this->addType('fingerprint', 'string');
+ $this->addType('unread', 'boolean');
+ $this->addType('starred', 'boolean');
+ }
+
/**
* @return int
*/