CRM_Core_Config_MagicMerge
in package
Class CRM_Core_Config_MagicMerge
Originally, the $config object was based on a single, serialized data object stored in the database. As the needs for settings grew (with robust metadata, system overrides, extension support, and multi-tenancy), the $config started to store a mix of: (a) canonical config options, (b) dynamically generated runtime data, (c) cached data derived from other sources (esp civicrm_setting) (d) instances of service objects
The config object is now deprecated. Settings and service objects should generally be accessed via Civi::settings() and Civi::service().
MagicMerge provides backward compatibility. You may still access old properties via $config, but they will be loaded from their new services.
Table of Contents
Properties
- $cache : mixed
- $locals : mixed
- $map : array<string|int, mixed>
- Map old config properties to their contemporary counterparts.
- $settings : mixed
Methods
- __construct() : mixed
- CRM_Core_Config_MagicMerge constructor.
- __get() : mixed
- Get value.
- __isset() : bool
- Is value set.
- __set() : mixed
- Set value.
- __unset() : mixed
- Unset value.
- __wakeup() : mixed
- Set the map to the property map.
- getPropertyMap() : array<string|int, mixed>
- Get a list of $config properties and the entities to which they map.
- getSettings() : SettingsBag
- initLocals() : mixed
- Initialise local settings.
Properties
$cache
private
mixed
$cache
= []
$locals
private
mixed
$locals
$map
Map old config properties to their contemporary counterparts.
private
array<string|int, mixed>
$map
Array(string $configAlias => Array(string $realType, string $realName)).
$settings
private
mixed
$settings
Methods
__construct()
CRM_Core_Config_MagicMerge constructor.
public
__construct() : mixed
__get()
Get value.
public
__get(string $k) : mixed
Parameters
- $k : string
Tags
__isset()
Is value set.
public
__isset(string $k) : bool
Parameters
- $k : string
Return values
bool__set()
Set value.
public
__set(string $k, mixed $v) : mixed
Parameters
- $k : string
- $v : mixed
Tags
__unset()
Unset value.
public
__unset(string $k) : mixed
Parameters
- $k : string
Tags
__wakeup()
Set the map to the property map.
public
__wakeup() : mixed
getPropertyMap()
Get a list of $config properties and the entities to which they map.
public
static getPropertyMap() : array<string|int, mixed>
This is used for two purposes:
- Runtime: Provide backward-compatible interface for reading these properties.
- Upgrade: Migrate old properties of config_backend into settings.
Return values
array<string|int, mixed>getSettings()
protected
getSettings() : SettingsBag
Return values
SettingsBaginitLocals()
Initialise local settings.
private
initLocals() : mixed