From cf4c32ddeea91eee6f4a8fd30a92b288d9120a69 Mon Sep 17 00:00:00 2001 From: Seamus Lee Date: Tue, 16 Jul 2019 00:19:22 +1000 Subject: [PATCH] Add in Deprecation warnings on Cache functons --- CRM/Core/BAO/Cache.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/CRM/Core/BAO/Cache.php b/CRM/Core/BAO/Cache.php index d5b4ade2f2..e71e24e368 100644 --- a/CRM/Core/BAO/Cache.php +++ b/CRM/Core/BAO/Cache.php @@ -73,6 +73,9 @@ class CRM_Core_BAO_Cache extends CRM_Core_DAO_Cache { * @deprecated */ public static function &getItem($group, $path, $componentID = NULL) { + CRM_Core_Error::deprecatedFunctionWarning( + 'CRM_Core_BAO_Cache::getItem is deprecated and will be removed from core soon, use Civi::cache() facade or define cache group using hook_civicrm_container' + ); if (($adapter = CRM_Utils_Constant::value('CIVICRM_BAO_CACHE_ADAPTER')) !== NULL) { $value = $adapter::getItem($group, $path, $componentID); return $value; @@ -116,6 +119,9 @@ class CRM_Core_BAO_Cache extends CRM_Core_DAO_Cache { * @deprecated */ public static function &getItems($group, $componentID = NULL) { + CRM_Core_Error::deprecatedFunctionWarning( + 'CRM_Core_BAO_Cache::getItems is deprecated and will be removed from core soon, use Civi::cache() facade or define cache group using hook_civicrm_container' + ); if (($adapter = CRM_Utils_Constant::value('CIVICRM_BAO_CACHE_ADAPTER')) !== NULL) { return $adapter::getItems($group, $componentID); } @@ -161,6 +167,9 @@ class CRM_Core_BAO_Cache extends CRM_Core_DAO_Cache { * @deprecated */ public static function setItem(&$data, $group, $path, $componentID = NULL) { + CRM_Core_Error::deprecatedFunctionWarning( + 'CRM_Core_BAO_Cache::setItem is deprecated and will be removed from core soon, use Civi::cache() facade or define cache group using hook_civicrm_container' + ); if (($adapter = CRM_Utils_Constant::value('CIVICRM_BAO_CACHE_ADAPTER')) !== NULL) { return $adapter::setItem($data, $group, $path, $componentID); } @@ -232,6 +241,9 @@ class CRM_Core_BAO_Cache extends CRM_Core_DAO_Cache { * @deprecated */ public static function deleteGroup($group = NULL, $path = NULL, $clearAll = TRUE) { + CRM_Core_Error::deprecatedFunctionWarning( + 'CRM_Core_BAO_Cache::deleteGroup is deprecated and will be removed from core soon, use Civi::cache() facade or define cache group using hook_civicrm_container' + ); if (($adapter = CRM_Utils_Constant::value('CIVICRM_BAO_CACHE_ADAPTER')) !== NULL) { return $adapter::deleteGroup($group, $path); } -- 2.25.1