SettingsBag
class SettingsBag
Class SettingsBag
Properties
protected | $domainId | ||
protected | $contactId | ||
protected array | $defaults | ||
protected array | $mandatory | ||
protected array|null | $combined | The result of combining default values, mandatory values, and user values. | |
protected array | $values |
Methods
No description
Set/replace the default values.
Set/replace the mandatory values.
Load all explicit settings that apply to this domain or contact.
Add a batch of settings. Save them.
Get a list of all effective settings.
Determine the effective value.
Determine the default value of a setting.
Determine the explicitly designated value, regardless of any default or mandatory values.
Determine the mandatory value of a setting.
Determine if the entity has explicitly designated a value.
Removes any explicit settings. This restores the default.
Add a single setting. Save it.
No description
Combine a series of arrays, excluding any null values. Later values override earlier values.
Update the DB record for this setting.
Details
at line 89
__construct(int $domainId, int|null $contactId)
at line 103
SettingsBag
loadDefaults(array $defaults)
Set/replace the default values.
at line 116
SettingsBag
loadMandatory(array $mandatory)
Set/replace the mandatory values.
at line 127
SettingsBag
loadValues()
Load all explicit settings that apply to this domain or contact.
at line 167
SettingsBag
add(array $settings)
Add a batch of settings. Save them.
at line 180
array
all()
Get a list of all effective settings.
at line 195
mixed
get(string $key)
Determine the effective value.
at line 207
mixed|NULL
getDefault(string $key)
Determine the default value of a setting.
at line 219
mixed|NULL
getExplicit(string $key)
Determine the explicitly designated value, regardless of any default or mandatory values.
at line 230
mixed|NULL
getMandatory(string $key)
Determine the mandatory value of a setting.
at line 244
bool
hasExplict(string $key)
Determine if the entity has explicitly designated a value.
Note that get() may still return other values based on mandatory values or defaults.
at line 256
SettingsBag
revert(string $key)
Removes any explicit settings. This restores the default.
at line 271
SettingsBag
set(string $key, mixed $value)
Add a single setting. Save it.
at line 281
protected CRM_Utils_SQL_Select
createQuery()
at line 308
protected array
combine(array $arrays)
Combine a series of arrays, excluding any null values. Later values override earlier values.
at line 328
protected
setDb(string $name, mixed $value)
Update the DB record for this setting.