abstract class ConfigNormalizerBase in Configuration Normalizer 8
Same name and namespace in other branches
- 2.0.x src/Plugin/ConfigNormalizerBase.php \Drupal\config_normalizer\Plugin\ConfigNormalizerBase
Base class for Config normalizer plugins.
Hierarchy
- class \Drupal\Component\Plugin\PluginBase implements DerivativeInspectionInterface, PluginInspectionInterface
- class \Drupal\config_normalizer\Plugin\ConfigNormalizerBase implements ConfigNormalizerInterface
Expanded class hierarchy of ConfigNormalizerBase
3 files declare their use of ConfigNormalizerBase
- ConfigNormalizerActive.php in src/
Plugin/ ConfigNormalizer/ ConfigNormalizerActive.php - ConfigNormalizerFilterFormat.php in src/
Plugin/ ConfigNormalizer/ ConfigNormalizerFilterFormat.php - ConfigNormalizerSort.php in src/
Plugin/ ConfigNormalizer/ ConfigNormalizerSort.php
File
- src/
Plugin/ ConfigNormalizerBase.php, line 13
Namespace
Drupal\config_normalizer\PluginView source
abstract class ConfigNormalizerBase extends PluginBase implements ConfigNormalizerInterface {
/**
* The entity type manager.
*
* @var \Drupal\Core\Entity\EntityTypeManagerInterface
*/
protected $entityTypeManager;
/**
* Creates a new config normalizer plugin.
*
* @param array $configuration
* A configuration array containing information about the plugin instance.
* @param string $plugin_id
* The plugin_id for the plugin instance.
* @param mixed $plugin_definition
* The plugin implementation definition.
* @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager
* The entity type manager.
*/
public function __construct(array $configuration, $plugin_id, $plugin_definition, EntityTypeManagerInterface $entity_type_manager) {
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->entityTypeManager = $entity_type_manager;
}
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
return new static($configuration, $plugin_id, $plugin_definition, $container
->get('entity_type.manager'));
}
/**
* Determines whether the context has a default normalization mode.
*
* @param array $context
* An array of key-value pairs to pass additional context when needed.
*
* @return bool
* TRUE if the context normalization mode is default. Otherwise, FALSE.
*/
protected function isDefaultModeContext(array $context) {
return !empty($context['normalization_mode']) && $context['normalization_mode'] === NormalizedReadOnlyStorageInterface::DEFAULT_NORMALIZATION_MODE;
}
/**
* Determines whether the context reference storage is the active storage.
*
* @param array $context
* An array of key-value pairs to pass additional context when needed.
*
* @return bool
* TRUE if the context normalization mode is default. Otherwise, FALSE.
*/
protected function isActiveStorageContext(array $context) {
if (!empty($context['reference_storage_service']) && !empty($context['reference_storage_service']->_serviceId) && $context['reference_storage_service']->_serviceId === 'config.storage') {
return TRUE;
}
return FALSE;
}
}
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:: |
|
ConfigNormalizerInterface:: |
public | function | Normalizes config for comparison. | 3 |
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. |