class ConfigNormalizerFilterFormat in Configuration Normalizer 8
Same name and namespace in other branches
- 2.0.x src/Plugin/ConfigNormalizer/ConfigNormalizerFilterFormat.php \Drupal\config_normalizer\Plugin\ConfigNormalizer\ConfigNormalizerFilterFormat
Normalizes filter_format config entity data.
Plugin annotation
@ConfigNormalizer(
id = "filter_format",
label = @Translation("Filter format"),
weight = 20,
description = @Translation("Removes the roles element from filter formats, since this element is valid only on exported configuration."),
)
Hierarchy
- class \Drupal\Component\Plugin\PluginBase implements DerivativeInspectionInterface, PluginInspectionInterface
- class \Drupal\config_normalizer\Plugin\ConfigNormalizerBase implements ConfigNormalizerInterface
- class \Drupal\config_normalizer\Plugin\ConfigNormalizer\ConfigNormalizerFilterFormat implements ContainerFactoryPluginInterface
- class \Drupal\config_normalizer\Plugin\ConfigNormalizerBase implements ConfigNormalizerInterface
Expanded class hierarchy of ConfigNormalizerFilterFormat
File
- src/
Plugin/ ConfigNormalizer/ ConfigNormalizerFilterFormat.php, line 19
Namespace
Drupal\config_normalizer\Plugin\ConfigNormalizerView source
class ConfigNormalizerFilterFormat extends ConfigNormalizerBase implements ContainerFactoryPluginInterface {
/**
* {@inheritdoc}
*/
public function normalize($name, array &$data, array $context) {
// In 'prepare' context we don't change data that's needed at write time.
if ($this
->isDefaultModeContext($context) && ($filter_format = $this->entityTypeManager
->getDefinition('filter_format', FALSE))) {
$prefix = $filter_format
->getConfigPrefix();
// The "roles" element from filter formats is valid only on exported
// configuration.
if (strpos($name, $prefix . '.') === 0) {
unset($data['roles']);
}
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
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:: |
|
ConfigNormalizerFilterFormat:: |
public | function |
Normalizes config for comparison. Overrides ConfigNormalizerInterface:: |
|
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:: |
3 |
PluginBase:: |
public | function |
Gets the plugin_id of the plugin instance. Overrides PluginInspectionInterface:: |
|
PluginBase:: |
public | function | Determines if the plugin is configurable. |