From ca653f65933e97464f75d6206cd29064deaf7e39 Mon Sep 17 00:00:00 2001 From: Marcin Materzok Date: Wed, 31 Aug 2022 12:19:12 +0200 Subject: [PATCH] Version 1.0.3 --- Api/Data/QuestionInterface.php | 12 ++++++++++++ Model/Question.php | 32 ++++++++++++++++++++++++++++++-- composer.json | 2 +- 3 files changed, 43 insertions(+), 3 deletions(-) diff --git a/Api/Data/QuestionInterface.php b/Api/Data/QuestionInterface.php index 7e1d9c0..f9a254f 100755 --- a/Api/Data/QuestionInterface.php +++ b/Api/Data/QuestionInterface.php @@ -66,6 +66,18 @@ public function getPosition(): int; */ public function setPosition(?int $position): QuestionInterface; + /** + * @return array + */ + public function getStoreIds(): array; + + /** + * @param array $storeIds + * + * @return QuestionInterface + */ + public function setStoreIds(array $storeIds): QuestionInterface; + /** * @return bool */ diff --git a/Model/Question.php b/Model/Question.php index 83a1212..2681167 100644 --- a/Model/Question.php +++ b/Model/Question.php @@ -141,13 +141,41 @@ public function setAnswer(?string $answer): QuestionInterface return $this->setData(self::ANSWER, $answer); } + /** + * @return bool + */ public function isActive(): bool { - // TODO: Implement isActive() method. + return (bool) $this->_getData(self::ACTIVE); } + /** + * @param bool $active + * + * @return QuestionInterface + */ public function setActive(bool $active): QuestionInterface { - // TODO: Implement setActive() method. + return $this->setData(self::ACTIVE, $active); + } + + /** + * @return array + */ + public function getStoreIds(): array + { + return (array) explode(",", $this->_getData(selfSTORE_IDSACTIVE)); + } + + /** + * @param array $storeIds + * + * @return QuestionInterface + */ + public function setStoreIds(array $storeIds): QuestionInterface + { + $storeIds = implode(",", $storeIds); + + return $this->setData(self::STORE_IDS, $storeIds); } } diff --git a/composer.json b/composer.json index d3cbfb1..8a0045f 100644 --- a/composer.json +++ b/composer.json @@ -5,7 +5,7 @@ ], "description": "Magento 2 module for manage FaqPage", "type": "magento2-module", - "version": "1.0.2", + "version": "1.0.3", "require": { "php": ">=7.4", "magento/framework": "*"