Documentation

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

$map

Map old config properties to their contemporary counterparts.

private array<string|int, mixed> $map

Array(string $configAlias => Array(string $realType, string $realName)).

Methods

__construct()

CRM_Core_Config_MagicMerge constructor.

public __construct() : mixed

__isset()

Is value set.

public __isset(string $k) : bool
Parameters
$k : string
Return values
bool

__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:

  1. Runtime: Provide backward-compatible interface for reading these properties.
  2. Upgrade: Migrate old properties of config_backend into settings.
Return values
array<string|int, mixed>

initLocals()

Initialise local settings.

private initLocals() : mixed

        
On this page

Search results