From e181dddfe042ea91fc083bbc38a34c00a6068d10 Mon Sep 17 00:00:00 2001 From: Daniel Seifert Date: Sun, 23 Apr 2023 22:35:14 +0200 Subject: [PATCH] add template block module setting handler bridge --- ...emplateBlockModuleSettingHandlerBridge.php | 46 +++++++++++++++++++ ...ockModuleSettingHandlerBridgeInterface.php | 26 +++++++++++ services.yaml | 7 +++ 3 files changed, 79 insertions(+) create mode 100644 Internal/Framework/Module/Setup/Bridge/TemplateBlockModuleSettingHandlerBridge.php create mode 100644 Internal/Framework/Module/Setup/Bridge/TemplateBlockModuleSettingHandlerBridgeInterface.php diff --git a/Internal/Framework/Module/Setup/Bridge/TemplateBlockModuleSettingHandlerBridge.php b/Internal/Framework/Module/Setup/Bridge/TemplateBlockModuleSettingHandlerBridge.php new file mode 100644 index 0000000..c83ffd7 --- /dev/null +++ b/Internal/Framework/Module/Setup/Bridge/TemplateBlockModuleSettingHandlerBridge.php @@ -0,0 +1,46 @@ + + * @link https://www.oxidmodule.com + */ + +declare(strict_types=1); + +namespace D3\OxidServiceBridges\Internal\Framework\Module\Setup\Bridge; + +use OxidEsales\EshopCommunity\Internal\Framework\Module\Configuration\DataObject\ModuleConfiguration; +use OxidEsales\EshopCommunity\Internal\Framework\Module\Setup\Handler\TemplateBlockModuleSettingHandler; + +class TemplateBlockModuleSettingHandlerBridge implements TemplateBlockModuleSettingHandlerBridgeInterface +{ + /** + * @var TemplateBlockModuleSettingHandler + */ + private $templateBlockModuleSettingHandlerService; + + /** + * @param TemplateBlockModuleSettingHandler $templateBlockModuleSettingHandlerService + */ + public function __construct(TemplateBlockModuleSettingHandler $templateBlockModuleSettingHandlerService) + { + $this->templateBlockModuleSettingHandlerService = $templateBlockModuleSettingHandlerService; + } + + public function handleOnModuleActivation(ModuleConfiguration $configuration, int $shopId) + { + $this->templateBlockModuleSettingHandlerService->handleOnModuleActivation($configuration, $shopId); + } + + public function handleOnModuleDeactivation(ModuleConfiguration $configuration, int $shopId) + { + $this->templateBlockModuleSettingHandlerService->handleOnModuleDeactivation($configuration, $shopId); + } +} + diff --git a/Internal/Framework/Module/Setup/Bridge/TemplateBlockModuleSettingHandlerBridgeInterface.php b/Internal/Framework/Module/Setup/Bridge/TemplateBlockModuleSettingHandlerBridgeInterface.php new file mode 100644 index 0000000..6aade69 --- /dev/null +++ b/Internal/Framework/Module/Setup/Bridge/TemplateBlockModuleSettingHandlerBridgeInterface.php @@ -0,0 +1,26 @@ + + * @link https://www.oxidmodule.com + */ + +declare(strict_types=1); + +namespace D3\OxidServiceBridges\Internal\Framework\Module\Setup\Bridge; + +use OxidEsales\EshopCommunity\Internal\Framework\Module\Configuration\DataObject\ModuleConfiguration; + +interface TemplateBlockModuleSettingHandlerBridgeInterface +{ + public function handleOnModuleActivation(ModuleConfiguration $configuration, int $shopId); + + public function handleOnModuleDeactivation(ModuleConfiguration $configuration, int $shopId); +} + diff --git a/services.yaml b/services.yaml index e00d103..f799e87 100644 --- a/services.yaml +++ b/services.yaml @@ -8,3 +8,10 @@ services: D3\OxidServiceBridges\Internal\Framework\Module\Path\ModulePathResolverBridgeInterface: class: D3\OxidServiceBridges\Internal\Framework\Module\Path\ModulePathResolverBridge + + D3\OxidServiceBridges\Internal\Framework\Module\Setup\Bridge\TemplateBlockModuleSettingHandlerBridgeInterface: + class: D3\OxidServiceBridges\Internal\Framework\Module\Setup\Bridge\TemplateBlockModuleSettingHandlerBridge + public: true + arguments: + $templateBlockModuleSettingHandlerService: '@oxid_esales.module.setup.template_blocks_module_setting_handler' +