SettingsManager
class SettingsManager
Class SettingsManager
Properties
protected CRM_Utils_Cache_Interface | $cache | ||
protected array | $bagsByDomain | ||
protected array | $bagsByContact | ||
protected array|null | $mandatory | ||
protected bool | $useDefaults | Whether to use defaults. |
Methods
Ensure that all defaults values are included with all current and future bags.
Ensure that mandatory values are included with all current and future bags.
Get Settings by domain.
Get Settings by contact.
Determine the default settings.
Get a list of mandatory/overriden settings.
Parse mandatory settings.
Flush all in-memory and persistent caches related to settings.
Details
at line 101
__construct(CRM_Utils_Cache_Interface $cache)
at line 111
SettingsManager
useDefaults()
Ensure that all defaults values are included with all current and future bags.
at line 142
SettingsManager
useMandatory()
Ensure that mandatory values are included with all current and future bags.
If you call useMandatory multiple times, it will re-scan the global $civicrm_setting.
at line 165
SettingsBag
getBagByDomain(int|null $domainId)
Get Settings by domain.
at line 195
SettingsBag
getBagByContact(int|null $domainId, int|null $contactId)
Get Settings by contact.
at line 227
protected array
getDefaults(string $entity)
Determine the default settings.
at line 256
protected array
getMandatory(string $entity)
Get a list of mandatory/overriden settings.
at line 281
static array
parseMandatorySettings(array $civicrm_setting)
Parse mandatory settings.
In previous versions, settings were broken down into verbose+dynamic group names, e.g.
$civicrm_settings['Foo Bar Preferences']['foo'] = 'bar';
We now simplify to two simple groups, 'domain' and 'contact'.
$civicrm_settings['domain']['foo'] = 'bar';
However, the old groups are grand-fathered in as aliases.
at line 322
SettingsManager
flush()
Flush all in-memory and persistent caches related to settings.