From 672645673feeeac2f926ac9675c2aab9a1ab378c Mon Sep 17 00:00:00 2001 From: bsiggel Date: Mon, 23 Mar 2026 20:40:11 +0100 Subject: [PATCH] Refactor CDokumente service to use dependency injection for FileStorageManager and FileManager; update microtime values in config and state files --- custom/Espo/Custom/Services/CDokumente.php | 20 +++++++++++++++----- data/config.php | 2 +- data/state.php | 4 ++-- 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/custom/Espo/Custom/Services/CDokumente.php b/custom/Espo/Custom/Services/CDokumente.php index 16b4ead6..80c8981a 100644 --- a/custom/Espo/Custom/Services/CDokumente.php +++ b/custom/Espo/Custom/Services/CDokumente.php @@ -12,11 +12,21 @@ use Espo\Core\Utils\File\Manager as FileManager; */ class CDokumente extends Record { - public function __construct( - private FileStorageManager $fileStorageManager, - private FileManager $fileManager - ) { - parent::__construct(); + private FileStorageManager $fileStorageManager; + private FileManager $fileManager; + + /** + * Inject additional dependencies via setter methods + * EspoCRM DI will automatically call these + */ + public function injectFileStorageManager(FileStorageManager $fileStorageManager): void + { + $this->fileStorageManager = $fileStorageManager; + } + + public function injectFileManager(FileManager $fileManager): void + { + $this->fileManager = $fileManager; } /** diff --git a/data/config.php b/data/config.php index 9489a8d4..6c065684 100644 --- a/data/config.php +++ b/data/config.php @@ -360,7 +360,7 @@ return [ 0 => 'youtube.com', 1 => 'google.com' ], - 'microtime' => 1774294521.215306, + 'microtime' => 1774294800.115291, 'siteUrl' => 'https://crm.bitbylaw.com', 'fullTextSearchMinLength' => 4, 'webSocketUrl' => 'ws://api.bitbylaw.com:5000/espocrm/ws', diff --git a/data/state.php b/data/state.php index f4717809..2c2f80dc 100644 --- a/data/state.php +++ b/data/state.php @@ -1,7 +1,7 @@ 1774294521, - 'microtimeState' => 1774294521.399129, + 'cacheTimestamp' => 1774294800, + 'microtimeState' => 1774294800.291216, 'currencyRates' => [ 'EUR' => 1.0 ],