use Civi:cache() for extension cache

This commit is contained in:
Marc Michalsky forumZFD 2021-01-18 10:46:47 +01:00
parent 1d5c69f470
commit 677f673247
Signed by untrusted user who does not match committer: marc.koch
GPG key ID: 12406554CFB028B9

View file

@ -11,8 +11,6 @@ use CRM_TwingleCampaign_ExtensionUtil as E;
*/ */
class CRM_TwingleCampaign_Utils_ExtensionCache { class CRM_TwingleCampaign_Utils_ExtensionCache {
protected static $_instance = NULL;
private $customFieldMapping; private $customFieldMapping;
private $translations; private $translations;
@ -26,10 +24,10 @@ class CRM_TwingleCampaign_Utils_ExtensionCache {
* @return self|null * @return self|null
*/ */
public static function getInstance() { public static function getInstance() {
if (null === self::$_instance) { if (null === Civi::cache()->get('twinglecampaign_cache')) {
self::$_instance = new self; Civi::cache()->set('twinglecampaign_cache', new self);
} }
return self::$_instance; return Civi::cache()->get('twinglecampaign_cache');
} }
/** /**