From c5a036b1b1be453f029c044e2fa9538d67f6217c Mon Sep 17 00:00:00 2001 From: Yaraslau Kavaliou Date: Wed, 30 Aug 2023 19:14:16 +0300 Subject: [PATCH] feat: Add DeliveryItemTypeRepository service --- .../DeliveryItemTypeRepository.conf.php | 3 + models/classes/DeliveryItemTypeRepository.php | 63 +++++++++++++++++++ 2 files changed, 66 insertions(+) create mode 100644 config/default/DeliveryItemTypeRepository.conf.php create mode 100644 models/classes/DeliveryItemTypeRepository.php diff --git a/config/default/DeliveryItemTypeRepository.conf.php b/config/default/DeliveryItemTypeRepository.conf.php new file mode 100644 index 000000000..236958ce7 --- /dev/null +++ b/config/default/DeliveryItemTypeRepository.conf.php @@ -0,0 +1,3 @@ +setOption(self::OPTION_DEFAULT_ITEM_TYPE, $type); + } + + /** + * Gets the default item type the viewer should manage + * @return string|bool + */ + public function getDefaultItemType() + { + if ($this->hasOption(self::OPTION_DEFAULT_ITEM_TYPE)) { + return $this->getOption(self::OPTION_DEFAULT_ITEM_TYPE); + } + + return false; + } + + /** + * Gets the type of item the viewer should manage + * @todo determine the item type from the $resultIdentifier + * @param string $resultIdentifier + * @return string + */ + public function getDeliveryItemType($resultIdentifier) + { + return $this->getDefaultItemType(); + } +}