*/
public static function setIsActive($id, $is_active) {
// note this also resets any ACL cache
- CRM_Core_BAO_Cache::deleteGroup('contact fields');
+ Civi::cache('fields')->flush();
return CRM_Core_DAO::setFieldValue('CRM_ACL_DAO_ACL', $id, 'is_active', $is_active);
}
*/
public function postProcess() {
// note this also resets any ACL cache
- CRM_Core_BAO_Cache::deleteGroup('contact fields');
+ Civi::cache('fields')->flush();
if ($this->_action & CRM_Core_Action::DELETE) {
CRM_ACL_BAO_ACL::del($this->_id);
//cache contact fields retaining localized titles
//though we changed localization, so reseting cache.
- CRM_Core_BAO_Cache::deleteGroup('contact fields');
+ Civi::cache('fields')->flush();
//CRM-8559, cache navigation do not respect locale if it is changed, so reseting cache.
Civi::cache('navigation')->flush();
$cacheKeyString .= $checkPermission ? '_1' : '_0';
$cacheKeyString .= '_' . CRM_Core_Config::domainID() . '_';
- $fields = CRM_Utils_Array::value($cacheKeyString, self::$_importableFields);
-
- if (!$fields) {
- // check if we can retrieve from database cache
- $fields = CRM_Core_BAO_Cache::getItem('contact fields', $cacheKeyString);
- }
+ $fields = CRM_Utils_Array::value($cacheKeyString, self::$_importableFields) ?: Civi::cache('fields')->get($cacheKeyString);
if (!$fields) {
$fields = CRM_Contact_DAO_Contact::import();
//Sorting fields in alphabetical order(CRM-1507)
$fields = CRM_Utils_Array::crmArraySortByField($fields, 'title');
- CRM_Core_BAO_Cache::setItem($fields, 'contact fields', $cacheKeyString);
+ Civi::cache('fields')->set($cacheKeyString, $fields);
}
self::$_importableFields[$cacheKeyString] = $fields;
}
// check if we can retrieve from database cache
- $fields = CRM_Core_BAO_Cache::getItem('contact fields', $cacheKeyString);
+ $fields = Civi::cache('fields')->get($cacheKeyString);
if (!$fields) {
$fields = CRM_Contact_DAO_Contact::export();
}
}
- CRM_Core_BAO_Cache::setItem($fields, 'contact fields', $cacheKeyString);
+ Civi::cache('fields')->set($cacheKeyString, $fields);
}
self::$_exportableFields[$cacheKeyString] = $fields;
}
*/
public static function getLegacyGroups() {
$groups = [
- // Core
- 'contact fields',
-
// Universe
// be.chiro.civi.atomfeeds
}
// check if we can retrieve from database cache
- $fields = CRM_Core_BAO_Cache::getItem('contact fields', "custom importableFields $cacheKey");
+ $fields = Civi::Cache('fields')->get("custom importableFields $cacheKey");
if ($fields === NULL) {
$cfTable = self::getTableName();
}
- CRM_Core_BAO_Cache::setItem($fields,
- 'contact fields',
- "custom importableFields $cacheKey"
- );
+ Civi::cache('fields')->set("custom importableFields $cacheKey", $fields);
}
self::$_importFields[$cacheKey] = $fields;
}
*/
public static function setIsActive($id, $is_active) {
// reset the cache
- CRM_Core_BAO_Cache::deleteGroup('contact fields');
+ Civi::cache('fields')->flush();
if (!$is_active) {
CRM_Core_BAO_UFField::setUFFieldStatus($id, $is_active);
$customField->save();
// Reset cache for custom fields
- CRM_Core_BAO_Cache::deleteGroup('contact fields');
+ Civi::cache('fields')->flush();
CRM_Core_Session::setStatus(ts('Input type of custom field \'%1\' has been successfully changed to \'%2\'.',
[1 => $this->_values['label'], 2 => $dstHtmlType]
$this->_id = $customField->id;
// reset the cache
- CRM_Core_BAO_Cache::deleteGroup('contact fields');
+ Civi::cache('fields')->flush();
$msg = '<p>' . ts("Custom field '%1' has been saved.", [1 => $customField->label]) . '</p>';
$group = CRM_Core_BAO_CustomGroup::create($params);
// reset the cache
- CRM_Core_BAO_Cache::deleteGroup('contact fields');
+ Civi::cache('fields')->flush();
if ($this->_action & CRM_Core_Action::UPDATE) {
CRM_Core_Session::setStatus(ts('Your custom field set \'%1 \' has been saved.', [1 => $group->title]), ts('Saved'), 'success');
// also reset the various static memory caches
// reset the memory or array cache
- CRM_Core_BAO_Cache::deleteGroup('contact fields', NULL, FALSE);
+ Civi::cache('fields')->flush();
// reset ACL cache
CRM_ACL_BAO_Cache::resetCache();
'groups' => 'contact groups',
'navigation' => 'navigation',
'customData' => 'custom data',
+ 'fields' => 'contact fields',
];
foreach ($basicCaches as $cacheSvc => $cacheGrp) {
$definitionParams = [