From efc3b7f17eb3649a14ec52cb7af1eb85ff44e0c6 Mon Sep 17 00:00:00 2001 From: Daniel Seifert Date: Fri, 6 Sep 2024 15:38:36 +0200 Subject: [PATCH] add ShopTemplateCacheServiceBridge --- .../Cache/ShopTemplateCacheServiceBridge.php | 42 +++++++++++++++++++ ...hopTemplateCacheServiceBridgeInterface.php | 26 ++++++++++++ services.yaml | 3 ++ 3 files changed, 71 insertions(+) create mode 100644 Internal/Framework/Templating/Cache/ShopTemplateCacheServiceBridge.php create mode 100644 Internal/Framework/Templating/Cache/ShopTemplateCacheServiceBridgeInterface.php diff --git a/Internal/Framework/Templating/Cache/ShopTemplateCacheServiceBridge.php b/Internal/Framework/Templating/Cache/ShopTemplateCacheServiceBridge.php new file mode 100644 index 0000000..1a4a6eb --- /dev/null +++ b/Internal/Framework/Templating/Cache/ShopTemplateCacheServiceBridge.php @@ -0,0 +1,42 @@ + + * @link https://www.oxidmodule.com + */ + +declare(strict_types=1); + +namespace D3\OxidServiceBridges\Internal\Framework\Templating\Cache; + +use OxidEsales\EshopCommunity\Internal\Framework\Templating\Cache\ShopTemplateCacheServiceInterface; + +class ShopTemplateCacheServiceBridge implements ShopTemplateCacheServiceBridgeInterface +{ + /** + * @var $shopTemplateCacheService + */ + private ShopTemplateCacheServiceInterface $shopTemplateCacheService; + + public function __construct( + ShopTemplateCacheServiceInterface $shopTemplateCacheService + ) { + $this->shopTemplateCacheService = $shopTemplateCacheService; + } + + /** + * @param int $shopId + * + * @return void + */ + public function invalidateCache(int $shopId): void + { + $this->shopTemplateCacheService->invalidateCache( $shopId); + } +} \ No newline at end of file diff --git a/Internal/Framework/Templating/Cache/ShopTemplateCacheServiceBridgeInterface.php b/Internal/Framework/Templating/Cache/ShopTemplateCacheServiceBridgeInterface.php new file mode 100644 index 0000000..2a3a9f5 --- /dev/null +++ b/Internal/Framework/Templating/Cache/ShopTemplateCacheServiceBridgeInterface.php @@ -0,0 +1,26 @@ + + * @link https://www.oxidmodule.com + */ + +declare(strict_types=1); + +namespace D3\OxidServiceBridges\Internal\Framework\Templating\Cache; + +interface ShopTemplateCacheServiceBridgeInterface +{ + /** + * @param int $shopId + * + * @return void + */ + public function invalidateCache(int $shopId): void; +} \ No newline at end of file diff --git a/services.yaml b/services.yaml index 9153175..b1a9055 100644 --- a/services.yaml +++ b/services.yaml @@ -5,3 +5,6 @@ services: D3\OxidServiceBridges\Internal\Framework\Module\Path\ModulePathResolverBridgeInterface: class: D3\OxidServiceBridges\Internal\Framework\Module\Path\ModulePathResolverBridge + + D3\OxidServiceBridges\Internal\Framework\Templating\Cache\ShopTemplateCacheServiceBridgeInterface: + class: D3\OxidServiceBridges\Internal\Framework\Templating\Cache\ShopTemplateCacheServiceBridge