From 677f673247a5702e537418ed730dbe8e94acd235 Mon Sep 17 00:00:00 2001 From: Marc Michalsky forumZFD Date: Mon, 18 Jan 2021 10:46:47 +0100 Subject: [PATCH] use Civi:cache() for extension cache --- CRM/TwingleCampaign/Utils/ExtensionCache.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/CRM/TwingleCampaign/Utils/ExtensionCache.php b/CRM/TwingleCampaign/Utils/ExtensionCache.php index ebcd978..180a753 100644 --- a/CRM/TwingleCampaign/Utils/ExtensionCache.php +++ b/CRM/TwingleCampaign/Utils/ExtensionCache.php @@ -11,8 +11,6 @@ use CRM_TwingleCampaign_ExtensionUtil as E; */ class CRM_TwingleCampaign_Utils_ExtensionCache { - protected static $_instance = NULL; - private $customFieldMapping; private $translations; @@ -26,10 +24,10 @@ class CRM_TwingleCampaign_Utils_ExtensionCache { * @return self|null */ public static function getInstance() { - if (null === self::$_instance) { - self::$_instance = new self; + if (null === Civi::cache()->get('twinglecampaign_cache')) { + Civi::cache()->set('twinglecampaign_cache', new self); } - return self::$_instance; + return Civi::cache()->get('twinglecampaign_cache'); } /**