class ConfigNormalizerActive in Configuration Normalizer 2.0.x
Same name and namespace in other branches
- 8 src/Plugin/ConfigNormalizer/ConfigNormalizerActive.php \Drupal\config_normalizer\Plugin\ConfigNormalizer\ConfigNormalizerActive
Normalizes configuration potentially saved to the active storage.
Plugin annotation
@ConfigNormalizer(
id = "active",
label = @Translation("Active"),
weight = 0,
description = @Translation("Copies over properties that are set by core when configuration is saved to the active storage."),
)
Hierarchy
- class \Drupal\Component\Plugin\PluginBase implements DerivativeInspectionInterface, PluginInspectionInterface
- class \Drupal\config_normalizer\Plugin\ConfigNormalizerBase implements ConfigNormalizerInterface
- class \Drupal\config_normalizer\Plugin\ConfigNormalizer\ConfigNormalizerActive implements ContainerFactoryPluginInterface
- class \Drupal\config_normalizer\Plugin\ConfigNormalizerBase implements ConfigNormalizerInterface
Expanded class hierarchy of ConfigNormalizerActive
Deprecated
in config_normalizer:2.0.0-alpha1 and is removed from config_normalizer:2.0.0. No replacement.
See also
https://www.drupal.org/project/config_normalizer/issues/3230398
File
- src/
Plugin/ ConfigNormalizer/ ConfigNormalizerActive.php, line 21
Namespace
Drupal\config_normalizer\Plugin\ConfigNormalizerView source
class ConfigNormalizerActive extends ConfigNormalizerBase implements ContainerFactoryPluginInterface {
/**
* {@inheritdoc}
*/
public function normalize($name, array &$data, array $context) {
if ($this
->isActiveStorageContext($context) && ($active_data = $context['reference_storage_service']
->read($name))) {
// system.site.uuid may be set but empty.
if (isset($data['uuid']) && empty($data['uuid'])) {
unset($data['uuid']);
}
// Merge in uuid and _core while retaining the key order.
$merged = array_replace($active_data, $data);
$data = array_intersect_key($merged, array_flip(array_merge(array_keys($data), [
'uuid',
'_core',
])));
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ConfigNormalizerActive:: |
public | function |
Normalizes config for comparison. Overrides ConfigNormalizerInterface:: |
|
ConfigNormalizerBase:: |
protected | property | The entity type manager. | |
ConfigNormalizerBase:: |
public static | function | ||
ConfigNormalizerBase:: |
protected | function | Determines whether the context reference storage is the active storage. | |
ConfigNormalizerBase:: |
protected | function | Determines whether the context has a default normalization mode. | |
ConfigNormalizerBase:: |
public | function |
Creates a new config normalizer plugin. Overrides PluginBase:: |
|
PluginBase:: |
protected | property | Configuration information passed into the plugin. | 1 |
PluginBase:: |
protected | property | The plugin implementation definition. | 1 |
PluginBase:: |
protected | property | The plugin_id. | |
PluginBase:: |
constant | A string which is used to separate base plugin IDs from the derivative ID. | ||
PluginBase:: |
public | function |
Gets the base_plugin_id of the plugin instance. Overrides DerivativeInspectionInterface:: |
|
PluginBase:: |
public | function |
Gets the derivative_id of the plugin instance. Overrides DerivativeInspectionInterface:: |
|
PluginBase:: |
public | function |
Gets the definition of the plugin implementation. Overrides PluginInspectionInterface:: |
2 |
PluginBase:: |
public | function |
Gets the plugin_id of the plugin instance. Overrides PluginInspectionInterface:: |
|
PluginBase:: |
public | function | Determines if the plugin is configurable. |