From f21738471675367e5dd09b78808f64830549673c Mon Sep 17 00:00:00 2001 From: Jimmy Huynh Date: Sat, 13 Mar 2021 00:45:32 +0100 Subject: =?UTF-8?q?=E2=9C=A8=20Update=20'Item'=20model:=20add=20'tags'=20f?= =?UTF-8?q?ield?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jimmy Huynh --- lib/Db/Item.php | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/lib/Db/Item.php b/lib/Db/Item.php index abfcf6506..6ae0d7975 100644 --- a/lib/Db/Item.php +++ b/lib/Db/Item.php @@ -63,6 +63,8 @@ class Item extends Entity implements IAPI, \JsonSerializable protected $unread = false; /** @var bool */ protected $starred = false; + /** @var string|null */ + protected $tags; public function __construct() { @@ -85,6 +87,7 @@ class Item extends Entity implements IAPI, \JsonSerializable $this->addType('fingerprint', 'string'); $this->addType('unread', 'boolean'); $this->addType('starred', 'boolean'); + $this->addType('tags', 'string'); } /** @@ -275,6 +278,14 @@ class Item extends Entity implements IAPI, \JsonSerializable return $this->unread; } + /** + * @return null|string + */ + public function getTags(): ?string + { + return $this->tags; + } + /** * Turns entity attributes into an array */ @@ -505,6 +516,16 @@ class Item extends Entity implements IAPI, \JsonSerializable return $this; } + public function setTags(string $tags): self + { + if ($this->tags !== $tags) { + $this->tags = $tags; + $this->markFieldUpdated('tags'); + } + + return $this; + } + public function toAPI(): array { return [ -- cgit v1.2.3