From 8674d558fca1e90e7d7425e9d794b1cd01a87ad0 Mon Sep 17 00:00:00 2001 From: Marco Nassabain Date: Thu, 18 Mar 2021 22:12:48 +0100 Subject: =?UTF-8?q?=E2=9C=A8=20Update=20Item=20model:=20add=20sharedByDisp?= =?UTF-8?q?layName=20-=20added=20field=20+=20setters=20+=20getters=20-=20i?= =?UTF-8?q?nclude=20field=20in=20serialized=20Item?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marco Nassabain --- lib/Db/Item.php | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/Db/Item.php b/lib/Db/Item.php index 7bb9147b5..81bbe85a8 100644 --- a/lib/Db/Item.php +++ b/lib/Db/Item.php @@ -69,6 +69,8 @@ class Item extends Entity implements IAPI, \JsonSerializable protected $categoriesJson; /** @var string */ protected $sharedBy; + /** @var string|null */ + protected $sharedByDisplayName; public function __construct() { @@ -321,6 +323,11 @@ class Item extends Entity implements IAPI, \JsonSerializable return $this->sharedBy; } + public function getSharedByDisplayName(): ?string + { + return $this->sharedByDisplayName; + } + /** * @return null|string */ @@ -364,7 +371,8 @@ class Item extends Entity implements IAPI, \JsonSerializable 'intro' => $this->getIntro(), 'fingerprint' => $this->getFingerprint(), 'categories' => $this->getCategories(), - 'sharedBy' => $this->getSharedBy() + 'sharedBy' => $this->getSharedBy(), + 'sharedByDisplayName' => $this->getSharedByDisplayName() ]; } @@ -556,6 +564,16 @@ class Item extends Entity implements IAPI, \JsonSerializable return $this; } + public function setSharedByDisplayName(string $sharedByDisplayName = null): self + { + if ($this->sharedByDisplayName !== $sharedByDisplayName) { + $this->sharedByDisplayName = $sharedByDisplayName; + $this->markFieldUpdated('sharedByDisplayName'); + } + + return $this; + } + public function setUnread(bool $unread): self { if ($this->unread !== $unread) { -- cgit v1.2.3