diff options
author | Marco Nassabain <marco.nassabain@hotmail.com> | 2021-03-18 22:12:48 +0100 |
---|---|---|
committer | Sean Molenaar <SMillerDev@users.noreply.github.com> | 2021-04-08 22:31:21 +0200 |
commit | 8674d558fca1e90e7d7425e9d794b1cd01a87ad0 (patch) | |
tree | 1be8f979935063ea64574fd1cfe873e80ee0938e /lib/Db | |
parent | 0fdd88df550dcac8ce2727461e1810c25021e6eb (diff) |
✨ Update Item model: add sharedByDisplayName
- added field + setters + getters
- include field in serialized Item
Signed-off-by: Marco Nassabain <marco.nassabain@hotmail.com>
Diffstat (limited to 'lib/Db')
-rw-r--r-- | lib/Db/Item.php | 20 |
1 files changed, 19 insertions, 1 deletions
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) { |