diff --git a/config/default/DeliveryItemTypeService.conf.php b/config/default/DeliveryItemTypeService.conf.php new file mode 100644 index 000000000..85b8bab35 --- /dev/null +++ b/config/default/DeliveryItemTypeService.conf.php @@ -0,0 +1,21 @@ +getServiceLocator()->register(DeliveryItemTypeService::SERVICE_ID, $deliveryItemTypeService); + } + + public function down(Schema $schema): void + { + $this->throwIrreversibleMigrationException(); + } +} diff --git a/models/classes/DeliveryItemTypeService.php b/models/classes/DeliveryItemTypeService.php new file mode 100644 index 000000000..f5b426e16 --- /dev/null +++ b/models/classes/DeliveryItemTypeService.php @@ -0,0 +1,63 @@ +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(); + } +}