diff --git a/Api/CategoryWidgetRepositoryInterface.php b/Api/CategoryWidgetRepositoryInterface.php new file mode 100755 index 0000000000000000000000000000000000000000..151798d1e1b3ede46fcafa4e1e1f7a5a798611b4 --- /dev/null +++ b/Api/CategoryWidgetRepositoryInterface.php @@ -0,0 +1,60 @@ +<?php +namespace NicolasBejean\CategoryWidget\Api; + +/** + * Interface CategoryWidgetRepositoryInterface + * + * @category PHP + * @package NicolasBejean\CategoryWidget\Api + * @author Nicolas Béjean <nicolas@bejean.eu> + * @license https://github.com/nicolasbejean/category-widget/blob/master/licence.txt BSD Licence + * @link https://www.bejean.eu + */ +interface CategoryWidgetRepositoryInterface +{ + /** + * Save Category Widget + * + * @param \NicolasBejean\CategoryWidget\Api\Data\CategoryWidgetInterface $imageSlider + * @return \NicolasBejean\CategoryWidget\Api\Data\CategoryWidgetInterface + * @throws \Magento\Framework\Exception\LocalizedException + */ + public function save(Data\CategoryWidgetInterface $imageSlider); + + /** + * Get Category Widget by ID + * + * @param int $id + * @return \NicolasBejean\CategoryWidget\Api\Data\CategoryWidgetInterface + * @throws \Magento\Framework\Exception\LocalizedException + */ + public function getById($id); + + /** + * Get Category Widget by list + * + * @param \Magento\Framework\Api\SearchCriteriaInterface $searchCriteria + * @return \NicolasBejean\CategoryWidget\Api\Data\CategoryWidgetSearchResultsInterface + * @throws \Magento\Framework\Exception\LocalizedException + */ + public function getList(\Magento\Framework\Api\SearchCriteriaInterface $searchCriteria); + + /** + * Delete Category Widget + * + * @param \NicolasBejean\CategoryWidget\Api\Data\CategoryWidgetInterface $imageSlider + * @return bool true on success + * @throws \Magento\Framework\Exception\LocalizedException + */ + public function delete(Data\CategoryWidgetInterface $imageSlider); + + /** + * Delete Category Widget by ID + * + * @param int $id + * @return bool true on success + * @throws \Magento\Framework\Exception\NoSuchEntityException + * @throws \Magento\Framework\Exception\LocalizedException + */ + public function deleteById($id); +} diff --git a/Api/Data/CategoryWidgetInterface.php b/Api/Data/CategoryWidgetInterface.php new file mode 100755 index 0000000000000000000000000000000000000000..c775dd290e8647a92800ba8733b76a640d8df643 --- /dev/null +++ b/Api/Data/CategoryWidgetInterface.php @@ -0,0 +1,127 @@ +<?php +namespace NicolasBejean\CategoryWidget\Api\Data; + +/** + * Interface CategoryWidgetInterface + * + * @category PHP + * @package NicolasBejean\CategoryWidget\Api\Data + * @author Nicolas Béjean <nicolas@bejean.eu> + * @license https://github.com/nicolasbejean/category-widget/blob/master/licence.txt BSD Licence + * @link https://www.bejean.eu + */ +interface CategoryWidgetInterface +{ + const ENTITY_ID = 'entity_id'; + const TITLE = 'title'; + const IDENTIFIER = 'identifier'; + const CONTENT = 'content'; + const IS_ACTIVE = 'is_active'; + const CREATION_TIME = 'created_at'; + const UPDATE_TIME = 'updated_at'; + + /** + * Get Category Widget ID + * + * @return mixed + */ + public function getId(); + + /** + * Get Category Widget Title + * + * @return mixed + */ + public function getTitle(); + + /** + * Get Category Widget Identifier + * + * @return mixed + */ + public function getIdentifier(); + + /** + * Get Category Widget Content + * + * @return mixed + */ + public function getContent(); + + /** + * Get Category Widget Creation Time + * + * @return mixed + */ + public function getCreationTime(); + + /** + * Get Category Widget Update Time + * + * @return mixed + */ + public function getUpdateTime(); + + /** + * Get Category Widget Is Active + * + * @return mixed + */ + public function isActive(); + + /** + * Set Category Widget ID + * + * @param $id + * @return mixed + */ + public function setId($id); + + /** + * Set Category Widget Title + * + * @param $title + * @return mixed + */ + public function setTitle($title); + + /** + * Set Category Widget Identifier + * + * @param $identifier + * @return mixed + */ + public function setIdentifier($identifier); + + /** + * Set Category Widget Content + * + * @param $content + * @return mixed + */ + public function setContent($content); + + /** + * Set Category Widget Creation Time + * + * @param $creationTime + * @return mixed + */ + public function setCreationTime($creationTime); + + /** + * Set Category Widget Update Time + * + * @param $updateTime + * @return mixed + */ + public function setUpdateTime($updateTime); + + /** + * Set Category Widget is Active + * + * @param $isActive + * @return mixed + */ + public function setIsActive($isActive); +} diff --git a/Api/Data/CategoryWidgetSearchResultsInterface.php b/Api/Data/CategoryWidgetSearchResultsInterface.php new file mode 100755 index 0000000000000000000000000000000000000000..86c1be7c5669a438a9e2561efe93f91b92170f40 --- /dev/null +++ b/Api/Data/CategoryWidgetSearchResultsInterface.php @@ -0,0 +1,31 @@ +<?php +namespace NicolasBejean\CategoryWidget\Api\Data; + +use \Magento\Framework\Api\SearchResultsInterface; + +/** + * Interface CategoryWidgetSearchResultsInterface + * + * @category PHP + * @package NicolasBejean\CategoryWidget\Api\Data + * @author Nicolas Béjean <nicolas@bejean.eu> + * @license https://github.com/nicolasbejean/category-widget/blob/master/licence.txt BSD Licence + * @link https://www.bejean.eu + */ +interface CategoryWidgetSearchResultsInterface extends SearchResultsInterface +{ + /** + * Get Category Widget Items + * + * @return \NicolasBejean\CategoryWidget\Api\Data\CategoryWidgetInterface[] + */ + public function getItems(); + + /** + * Set Category Widget Items + * + * @param \NicolasBejean\CategoryWidget\Api\Data\CategoryWidgetInterface[] $items + * @return $this + */ + public function setItems(array $items); +} diff --git a/Api/GetCategoryWidgetByIdentifierInterface.php b/Api/GetCategoryWidgetByIdentifierInterface.php new file mode 100755 index 0000000000000000000000000000000000000000..3aa06aaa2316c487e8883871eaa619dbb8eb8d4a --- /dev/null +++ b/Api/GetCategoryWidgetByIdentifierInterface.php @@ -0,0 +1,25 @@ +<?php +namespace NicolasBejean\CategoryWidget\Api; + +use \NicolasBejean\CategoryWidget\Api\Data\CategoryWidgetInterface; + +/** + * Interface GetCategoryWidgetByIdentifierInterface + * + * @category PHP + * @package NicolasBejean\CategoryWidget\Api + * @author Nicolas Béjean <nicolas@bejean.eu> + * @license https://github.com/nicolasbejean/category-widget/blob/master/licence.txt BSD Licence + * @link https://www.bejean.eu + */ +interface GetCategoryWidgetByIdentifierInterface +{ + /** + * Load Category Widget data by given Item Identifier. + * + * @param string $identifier + * @param int $storeId + * @return CategoryWidgetInterface + */ + public function execute(string $identifier, int $storeId) : CategoryWidgetInterface; +}