class CRM_Core_BAO_Setting extends CRM_Core_DAO_Setting {
/**
- * Various predefined settings that have been migrated to the setting table
+ * Various predefined settings that have been migrated to the setting table.
*/
const
ADDRESS_STANDARDIZATION_PREFERENCES_NAME = 'Address Standardization Preferences',
}
/**
- * Allow key o be cleared
+ * Allow key o be cleared.
* @param string $cacheKey
*/
public static function flushCache($cacheKey) {
}
/**
- * Retrieve the value of a setting from the DB table
+ * Retrieve the value of a setting from the DB table.
*
* @param string $group
* (required) The group name of the item.
}
/**
- * Store an item in the setting table
+ * Store an item in the setting table.
*
* _setItem() is the common logic shared by setItem() and setItems().
*
}
/**
- * Store an item in a setting table
+ * Store an item in a setting table.
*
* _setItem() is the common logic shared by setItem() and setItems().
*
if (isset($metadata['on_change'])) {
foreach ($metadata['on_change'] as $callback) {
- call_user_func($callback, unserialize($dao->value), $value, $metadata);
+ call_user_func(
+ Civi\Core\Resolver::singleton()->get($callback),
+ unserialize($dao->value),
+ $value,
+ $metadata
+ );
}
}
return TRUE;
}
else {
- list($class, $fn) = explode('::', $fieldSpec['validate_callback']);
- if (!$class::$fn($value, $fieldSpec)) {
+ $cb = Civi\Core\Resolver::singleton()->get($fieldSpec['validate_callback']);
+ if (!call_user_func_array($cb, array(&$value, $fieldSpec))) {
throw new api_Exception("validation failed for {$fieldSpec['name']} = $value based on callback {$fieldSpec['validate_callback']}");
}
}
}
/**
- * Load the settings files defined in a series of folders
+ * Load the settings files defined in a series of folders.
* @param array $metaDataFolders
* List of folder paths.
* @return array
}
/**
- * Load up settings metadata from files
+ * Load up settings metadata from files.
*/
public static function loadSettingsMetadata($metaDataFolder) {
$settingMetaData = array();