diff options
author | dartcafe <github@dartcafe.de> | 2020-09-03 19:07:37 +0300 |
---|---|---|
committer | dartcafe <github@dartcafe.de> | 2020-09-03 19:07:37 +0300 |
commit | 7cfa3ac5f2aa3559cd3856546da359cef8d6680d (patch) | |
tree | 384b2379495bd41f164dda12d78f1874604e382c /lib/Db | |
parent | c72e917f10ca25c691813e191ebec90b7da88d92 (diff) |
Adding option for important polls
Diffstat (limited to 'lib/Db')
-rw-r--r-- | lib/Db/Poll.php | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/Db/Poll.php b/lib/Db/Poll.php index 7a6b064d..dddbb17e 100644 --- a/lib/Db/Poll.php +++ b/lib/Db/Poll.php @@ -63,6 +63,8 @@ use OCP\AppFramework\Db\Entity; * @method void setShowResults(string $value) * @method int getAdminAccess() * @method void setAdminAccess(integer $value) + * @method int getImportant() + * @method void setImportant(integer $value) */ class Poll extends Entity implements JsonSerializable { @@ -114,6 +116,9 @@ class Poll extends Entity implements JsonSerializable { /** @var int $adminAccess*/ protected $adminAccess; + /** @var int $important*/ + protected $important; + public function jsonSerialize() { return [ 'id' => intval($this->id), @@ -131,7 +136,8 @@ class Poll extends Entity implements JsonSerializable { 'voteLimit' => intval($this->voteLimit), 'showResults' => $this->showResults, 'adminAccess' => intVal($this->adminAccess), - 'ownerDisplayName' => $this->getDisplayName() + 'ownerDisplayName' => $this->getDisplayName(), + 'important' => intVal($this->important) ]; } @@ -146,6 +152,7 @@ class Poll extends Entity implements JsonSerializable { $this->setShowResults(isset($array['showResults']) ? $array['showResults'] : $this->getShowResults()); $this->setDeleted(isset($array['deleted']) ? $array['deleted'] : $this->getDeleted()); $this->setAdminAccess(isset($array['adminAccess']) ? $array['adminAccess'] : $this->getAdminAccess()); + $this->setImportant(isset($array['important']) ? $array['important'] : $this->getImportant()); return $this; } |