Drupal 8  8.0.2
Config Class Reference
Inheritance diagram for Config:

Public Member Functions

 __construct ($name, StorageInterface $storage, EventDispatcherInterface $event_dispatcher, TypedConfigManagerInterface $typed_config)
 
 initWithData (array $data)
 
 get ($key= '')
 
 setData (array $data)
 
 setSettingsOverride (array $data)
 
 setModuleOverride (array $data)
 
 set ($key, $value)
 
 clear ($key)
 
 save ($has_trusted_data=FALSE)
 
 delete ()
 
 getRawData ()
 
 getOriginal ($key= '', $apply_overrides=TRUE)
 
- Public Member Functions inherited from StorableConfigBase
 save ($has_trusted_data=FALSE)
 
 delete ()
 
 initWithData (array $data)
 
 isNew ()
 
 getStorage ()
 
- Public Member Functions inherited from ConfigBase
 getName ()
 
 setName ($name)
 
 get ($key= '')
 
 setData (array $data)
 
 set ($key, $value)
 
 clear ($key)
 
 merge (array $data_to_merge)
 
 getCacheContexts ()
 
 getCacheTags ()
 
 getCacheMaxAge ()
 
- Public Member Functions inherited from RefinableCacheableDependencyInterface
 addCacheContexts (array $cache_contexts)
 
 addCacheTags (array $cache_tags)
 
 mergeCacheMaxAge ($max_age)
 
 addCacheableDependency ($other_object)
 

Protected Member Functions

 setOverriddenData ()
 
 resetOverriddenData ()
 
- Protected Member Functions inherited from StorableConfigBase
 getSchemaWrapper ()
 
 validateValue ($key, $value)
 
 castValue ($key, $value)
 
- Protected Member Functions inherited from ConfigBase
 validateKeys (array $data)
 
 castSafeStrings ($data)
 

Protected Attributes

 $eventDispatcher
 
 $overriddenData
 
 $moduleOverrides
 
 $settingsOverrides
 
- Protected Attributes inherited from StorableConfigBase
 $storage
 
 $schemaWrapper
 
 $typedConfigManager
 
 $isNew = TRUE
 
 $originalData = array()
 
- Protected Attributes inherited from ConfigBase
 $name
 
 $data = array()
 

Additional Inherited Members

- Static Public Member Functions inherited from ConfigBase
static validateName ($name)
 
- Data Fields inherited from ConfigBase
const MAX_NAME_LENGTH = 250
 

Detailed Description

Defines the default configuration object.

Encapsulates all capabilities needed for configuration handling for a specific configuration object, including support for runtime overrides. The overrides are handled on top of the stored configuration so they are not saved back to storage.

Constructor & Destructor Documentation

__construct (   $name,
StorageInterface  $storage,
EventDispatcherInterface  $event_dispatcher,
TypedConfigManagerInterface  $typed_config 
)

Constructs a configuration object.

Parameters
string$nameThe name of the configuration object being constructed.
\Drupal\Core\Config\StorageInterface$storageA storage object to use for reading and writing the configuration data.
\Symfony\Component\EventDispatcher\EventDispatcherInterface$event_dispatcherAn event dispatcher instance to use for configuration events.
\Drupal\Core\Config\TypedConfigManagerInterface$typed_configThe typed configuration manager service.

Member Function Documentation

clear (   $key)

{}

References Config\resetOverriddenData().

Here is the call graph for this function:

delete ( )

Deletes the configuration object.

Returns
The configuration object.

References ConfigBase\getCacheTags(), Cache\invalidateTags(), StorableConfigBase\isNew(), and Config\resetOverriddenData().

Here is the call graph for this function:

get (   $key = '')

{}

References NestedArray\getValue(), and Config\setOverriddenData().

Referenced by FieldUpdateTest\assertEntityRefDependency(), ConfigFactoryOverrideBase\filterOverride(), ConfigEntityStorage\importCreate(), FieldConfigStorage\importDelete(), ConfigEntityStorage\importUpdate(), and FormElementBase\setConfig().

Here is the call graph for this function:

Here is the caller graph for this function:

getOriginal (   $key = '',
  $apply_overrides = TRUE 
)

Gets original data from this configuration object.

Original data is the data as it is immediately after loading from configuration storage before any changes. If this is a new configuration object it will be an empty array.

See Also
::get()
Parameters
string$keyA string that maps to a key within the configuration data.
bool$apply_overridesApply any overrides to the original data. Defaults to TRUE.
Returns
mixed The data that was requested.

References NestedArray\getValue(), and NestedArray\mergeDeepArray().

Here is the call graph for this function:

getRawData ( )

Gets the raw data without overrides.

Returns
array The raw data.
initWithData ( array  $data)

{}

References Config\resetOverriddenData().

Referenced by ConfigImporter\importInvokeOwner(), and ConfigImporter\importInvokeRename().

Here is the call graph for this function:

Here is the caller graph for this function:

resetOverriddenData ( )
protected

Resets the current data, so overrides are re-applied.

This method should be called after the original data or the overridden data has been changed.

Returns
The configuration object.

Referenced by Config\clear(), Config\delete(), Config\initWithData(), Config\save(), Config\set(), Config\setData(), Config\setModuleOverride(), and Config\setSettingsOverride().

Here is the caller graph for this function:

save (   $has_trusted_data = FALSE)

{}

References StorableConfigBase\castValue(), ConfigBase\getCacheTags(), Cache\invalidateTags(), StorableConfigBase\isNew(), Config\resetOverriddenData(), and StorableConfigBase\validateValue().

Here is the call graph for this function:

set (   $key,
  $value 
)

{}

References Config\resetOverriddenData().

Here is the call graph for this function:

setData ( array  $data)

{}

References Config\resetOverriddenData().

Referenced by ConfigImporter\importInvokeOwner(), and ConfigImporter\importInvokeRename().

Here is the call graph for this function:

Here is the caller graph for this function:

setModuleOverride ( array  $data)

Sets module overrides for this configuration object.

Parameters
array$dataThe overridden values of the configuration data.
Returns
The configuration object.

References Config\resetOverriddenData().

Here is the call graph for this function:

setOverriddenData ( )
protected

Sets the current data for this configuration object.

Configuration overrides operate at two distinct layers: modules and settings.php. Overrides in settings.php take precedence over values provided by modules. Precedence or different module overrides is determined by the priority of the config.factory.override tagged services.

Returns
The configuration object.

References NestedArray\mergeDeepArray().

Referenced by Config\get().

Here is the call graph for this function:

Here is the caller graph for this function:

setSettingsOverride ( array  $data)

Sets settings.php overrides for this configuration object.

The overridden data only applies to this configuration object.

Parameters
array$dataThe overridden values of the configuration data.
Returns
The configuration object.

References Config\resetOverriddenData().

Here is the call graph for this function:


The documentation for this class was generated from the following file: