Commit 51d9879c authored by catch's avatar catch

Issue #2188595 by alexpott, jibran: Create a ConfigManager to be able to remove config.inc.

parent 9526bb82
......@@ -70,6 +70,9 @@ services:
class: Drupal\Core\Config\FileStorage
factory_class: Drupal\Core\Config\FileStorageFactory
factory_method: getActive
config.manager:
class: Drupal\Core\Config\ConfigManager
arguments: ['@entity.manager', '@config.factory', '@config.typed', '@string_translation']
config.storage:
class: Drupal\Core\Config\CachedStorage
arguments: ['@config.cachedstorage.storage', '@cache.config']
......@@ -83,7 +86,7 @@ services:
arguments: ['@config.storage', '@event_dispatcher', '@config.typed']
config.installer:
class: Drupal\Core\Config\ConfigInstaller
arguments: ['@config.factory', '@config.storage', '@config.typed', '@entity.manager', '@event_dispatcher']
arguments: ['@config.factory', '@config.storage', '@config.typed', '@config.manager', '@event_dispatcher']
config.storage.staging:
class: Drupal\Core\Config\FileStorage
factory_class: Drupal\Core\Config\FileStorageFactory
......@@ -540,7 +543,7 @@ services:
class: Drupal\Core\EventSubscriber\ConfigSnapshotSubscriber
tags:
- { name: event_subscriber }
arguments: ['@config.storage', '@config.storage.snapshot']
arguments: ['@config.manager', '@config.storage', '@config.storage.snapshot']
exception_controller:
class: Drupal\Core\Controller\ExceptionController
arguments: ['@content_negotiation', '@string_translation', '@title_resolver', '@html_page_renderer', '@html_fragment_renderer']
......
<?php
use Drupal\Component\Utility\Unicode;
use Drupal\Core\Config\Config;
use Drupal\Core\Config\ConfigException;
use Drupal\Core\Language\Language;
use Drupal\Core\Config\ExtensionInstallStorage;
use Drupal\Core\Config\FileStorage;
use Drupal\Core\Config\StorageInterface;
use Drupal\Core\Entity\EntityTypeInterface;
use Symfony\Component\Yaml\Dumper;
use Symfony\Component\EventDispatcher\EventDispatcher;
/**
* @file
* This is the API for configuration storage.
*/
/**
* Uninstalls the default configuration of a given extension.
*
* @param string $type
* The extension type; e.g., 'module' or 'theme'.
* @param string $name
* The name of the module or theme to install default configuration for.
*/
function config_uninstall_default_config($type, $name) {
$storage = \Drupal::service('config.storage');
$config_names = $storage->listAll($name . '.');
foreach ($config_names as $config_name) {
\Drupal::config($config_name)->delete();
}
$schema_dir = drupal_get_path($type, $name) . '/config/schema';
if (is_dir($schema_dir)) {
// Refresh the schema cache if uninstalling an extension that provides
// configuration schema.
\Drupal::service('config.typed')->clearCachedDefinitions();
}
}
/**
* Gets configuration object names starting with a given prefix.
*
* @see \Drupal\Core\Config\StorageInterface::listAll()
* @deprecated Deprecated since Drupal 8.x-dev, to be removed in Drupal 8.0.
* Use \Drupal::configFactory()->listAll() instead.
*/
function config_get_storage_names_with_prefix($prefix = '') {
return \Drupal::service('config.storage')->listAll($prefix);
return \Drupal::configFactory()->listAll($prefix);
}
/**
......@@ -54,7 +22,8 @@ function config_get_storage_names_with_prefix($prefix = '') {
* @code \Drupal::config('book.admin') @endcode will return a configuration
* object in which the book module can store its administrative settings.
*
* @deprecated as of Drupal 8.0. Use \Drupal::config() instead.
* @deprecated Deprecated since Drupal 8.x-dev, to be removed in Drupal 8.0.
* Use \Drupal::config() instead.
*
* @param string $name
* The name of the configuration object to retrieve. The name corresponds to
......@@ -69,27 +38,14 @@ function config($name) {
return \Drupal::config($name);
}
/**
* Returns the entity type of a configuration object.
*
* @param string $name
* The configuration object name.
*
* @return string|null
* Either the entity type name, or NULL if none match.
*/
function config_get_entity_type_by_name($name) {
$entities = array_filter(\Drupal::entityManager()->getDefinitions(), function (EntityTypeInterface $entity_type) use ($name) {
return ($config_prefix = $entity_type->getConfigPrefix()) && strpos($name, $config_prefix . '.') === 0;
});
return key($entities);
}
/**
* Returns the typed config manager service.
*
* Use the typed data manager service for creating typed configuration objects.
*
* @deprecated Deprecated since Drupal 8.x-dev, to be removed in Drupal 8.0.
* Use \Drupal::service('config.typed') instead.
*
* @see \Drupal\Core\TypedData\TypedDataManager::create()
*
* @return \Drupal\Core\Config\TypedConfigManager
......@@ -98,57 +54,3 @@ function config_typed() {
return \Drupal::service('config.typed');
}
/**
* Creates a configuration snapshot following a successful import.
*
* @param \Drupal\Core\Config\StorageInterface $source_storage
* The storage to synchronize configuration from.
* @param \Drupal\Core\Config\StorageInterface $snapshot_storage
* The storage to synchronize configuration to.
*/
function config_import_create_snapshot(StorageInterface $source_storage, StorageInterface $snapshot_storage) {
$snapshot_storage->deleteAll();
foreach ($source_storage->listAll() as $name) {
$snapshot_storage->write($name, $source_storage->read($name));
}
}
/**
* Return a formatted diff of a named config between two storages.
*
* @param \Drupal\Core\Config\StorageInterface $source_storage
* The storage to diff configuration from.
* @param \Drupal\Core\Config\StorageInterface $target_storage
* The storage to diff configuration to.
* @param string $name
* The name of the configuration object to diff.
*
* @return core/lib/Drupal/Component/Diff
* A formatted string showing the difference between the two storages.
*
* @todo Make renderer injectable
*/
function config_diff(StorageInterface $source_storage, StorageInterface $target_storage, $name) {
require_once DRUPAL_ROOT . '/core/lib/Drupal/Component/Diff/DiffEngine.php';
// The output should show configuration object differences formatted as YAML.
// But the configuration is not necessarily stored in files. Therefore, they
// need to be read and parsed, and lastly, dumped into YAML strings.
$dumper = new Dumper();
$dumper->setIndentation(2);
$source_data = explode("\n", $dumper->dump($source_storage->read($name), PHP_INT_MAX));
$target_data = explode("\n", $dumper->dump($target_storage->read($name), PHP_INT_MAX));
// Check for new or removed files.
if ($source_data === array('false')) {
// Added file.
$source_data = array(t('File added'));
}
if ($target_data === array('false')) {
// Deleted file.
$target_data = array(t('File removed'));
}
return new Diff($source_data, $target_data);
}
......@@ -2191,7 +2191,7 @@ function install_finished(&$install_state) {
// Save a snapshot of the initially installed configuration.
$active = \Drupal::service('config.storage');
$snapshot = \Drupal::service('config.storage.snapshot');
config_import_create_snapshot($active, $snapshot);
\Drupal::service('config.manager')->createSnapshot($active, $snapshot);
return $output;
}
......
......@@ -345,6 +345,13 @@ public function getLanguageConfigName($langcode, $name) {
return static::LANGUAGE_CONFIG_PREFIX . '.' . $langcode . '.' . $name;
}
/**
* {@inheritdoc}
*/
public function listAll($prefix = '') {
return $this->storage->listAll($prefix);
}
/**
* Determines if a particular configuration object can be overridden.
*
......
......@@ -182,4 +182,18 @@ public function getLanguageConfigNames(array $names);
*/
public function getLanguageConfigName($langcode, $name);
/**
* Gets configuration object names starting with a given prefix.
*
* @see \Drupal\Core\Config\StorageInterface::listAll()
*
* @param string $prefix
* (optional) The prefix to search for. If omitted, all configuration object
* names that exist are returned.
*
* @return array
* An array containing matching configuration object names.
*/
public function listAll($prefix = '');
}
......@@ -7,10 +7,7 @@
namespace Drupal\Core\Config;
use Drupal\Core\Config\TypedConfigManager;
use Drupal\Core\Entity\EntityManagerInterface;
use Drupal\Core\Lock\LockBackendInterface;
use Drupal\Component\Uuid\UuidInterface;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
/**
......@@ -54,25 +51,25 @@ class ConfigImporter {
protected $eventDispatcher;
/**
* The configuration factory.
* The configuration manager.
*
* @var \Drupal\Core\Config\ConfigFactory
* @var \Drupal\Core\Config\ConfigManagerInterface
*/
protected $configFactory;
protected $configManager;
/**
* The plugin manager for entities.
* The used lock backend instance.
*
* @var \Drupal\Core\Entity\EntityManagerInterface
* @var \Drupal\Core\Lock\LockBackendInterface
*/
protected $entityManager;
protected $lock;
/**
* The used lock backend instance.
* The typed config manager.
*
* @var \Drupal\Core\Lock\LockBackendInterface
* @var \Drupal\Core\Config\TypedConfigManager
*/
protected $lock;
protected $typedConfigManager;
/**
* List of changes processed by the import().
......@@ -88,20 +85,6 @@ class ConfigImporter {
*/
protected $validated;
/**
* The UUID service.
*
* @var \Drupal\Component\Uuid\UuidInterface
*/
protected $uuidService;
/**
* The typed config manager.
*
* @var \Drupal\Core\Config\TypedConfigManager
*/
protected $typedConfigManager;
/**
* Constructs a configuration import object.
*
......@@ -110,24 +93,18 @@ class ConfigImporter {
* access the source and target storage objects.
* @param \Symfony\Component\EventDispatcher\EventDispatcherInterface $event_dispatcher
* The event dispatcher used to notify subscribers of config import events.
* @param \Drupal\Core\Config\ConfigFactory $config_factory
* The config factory that statically caches config objects.
* @param \Drupal\Core\Entity\EntityManagerInterface $entity_manager
* The entity manager used to import config entities.
* @param \Drupal\Core\Config\ConfigManagerInterface $config_manager
* The configuration manager.
* @param \Drupal\Core\Lock\LockBackendInterface
* The lock backend to ensure multiple imports do not occur at the same time.
* @param \Drupal\Component\Uuid\UuidInterface $uuid_service
* The UUID service.
* @param \Drupal\Core\Config\TypedConfigManager $typed_config
* The typed configuration manager.
*/
public function __construct(StorageComparerInterface $storage_comparer, EventDispatcherInterface $event_dispatcher, ConfigFactory $config_factory, EntityManagerInterface $entity_manager, LockBackendInterface $lock, UuidInterface $uuid_service, TypedConfigManager $typed_config) {
public function __construct(StorageComparerInterface $storage_comparer, EventDispatcherInterface $event_dispatcher, ConfigManagerInterface $config_manager, LockBackendInterface $lock, TypedConfigManager $typed_config) {
$this->storageComparer = $storage_comparer;
$this->eventDispatcher = $event_dispatcher;
$this->configFactory = $config_factory;
$this->entityManager = $entity_manager;
$this->configManager = $config_manager;
$this->lock = $lock;
$this->uuidService = $uuid_service;
$this->typedConfigManager = $typed_config;
$this->processed = $this->storageComparer->getEmptyChangelist();
}
......@@ -294,7 +271,7 @@ protected function importInvokeOwner() {
$handled_by_module = FALSE;
// Validate the configuration object name before importing it.
// Config::validateName($name);
if ($entity_type = config_get_entity_type_by_name($name)) {
if ($entity_type = $this->configManager->getEntityTypeIdByName($name)) {
$old_config = new Config($name, $this->storageComparer->getTargetStorage(), $this->eventDispatcher, $this->typedConfigManager);
if ($old_data = $this->storageComparer->getTargetStorage()->read($name)) {
$old_config->initWithData($old_data);
......@@ -307,7 +284,7 @@ protected function importInvokeOwner() {
}
$method = 'import' . ucfirst($op);
$handled_by_module = $this->entityManager->getStorageController($entity_type)->$method($name, $new_config, $old_config);
$handled_by_module = $this->configManager->getEntityManager()->getStorageController($entity_type)->$method($name, $new_config, $old_config);
}
if (!empty($handled_by_module)) {
$this->setProcessed($op, $name);
......
......@@ -8,7 +8,6 @@
namespace Drupal\Core\Config;
use Drupal\Component\Utility\Unicode;
use Drupal\Core\Entity\EntityManagerInterface;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
class ConfigInstaller implements ConfigInstallerInterface {
......@@ -35,11 +34,11 @@ class ConfigInstaller implements ConfigInstallerInterface {
protected $typedConfig;
/**
* The entity manager.
* The configuration manager.
*
* @var \Drupal\Core\Entity\EntityManagerInterface
* @var \Drupal\Core\Config\ConfigManagerInterface
*/
protected $entityManager;
protected $configManager;
/**
* The event dispatcher.
......@@ -57,16 +56,16 @@ class ConfigInstaller implements ConfigInstallerInterface {
* The active configuration storage.
* @param \Drupal\Core\Config\TypedConfigManagerInterface $typed_config
* The typed configuration manager.
* @param \Drupal\Core\Entity\EntityManagerInterface $entity_manager
* The entity manager.
* @param \Drupal\Core\Config\ConfigManagerInterface $config_manager
* The configuration manager.
* @param \Symfony\Component\EventDispatcher\EventDispatcherInterface $event_dispatcher
* The event dispatcher.
*/
public function __construct(ConfigFactory $config_factory, StorageInterface $active_storage, TypedConfigManagerInterface $typed_config, EntityManagerInterface $entity_manager, EventDispatcherInterface $event_dispatcher) {
public function __construct(ConfigFactory $config_factory, StorageInterface $active_storage, TypedConfigManagerInterface $typed_config, ConfigManagerInterface $config_manager, EventDispatcherInterface $event_dispatcher) {
$this->configFactory = $config_factory;
$this->activeStorage = $active_storage;
$this->typedConfig = $typed_config;
$this->entityManager = $entity_manager;
$this->configManager = $config_manager;
$this->eventDispatcher = $event_dispatcher;
}
......@@ -119,8 +118,9 @@ public function installDefaultConfig($type, $name) {
if ($data !== FALSE) {
$new_config->setData($data);
}
if ($entity_type = config_get_entity_type_by_name($name)) {
$this->entityManager
if ($entity_type = $this->configManager->getEntityTypeIdByName($name)) {
$this->configManager
->getEntityManager()
->getStorageController($entity_type)
->create($new_config->get())
->save();
......
<?php
/**
* @file
* Contains \Drupal\Core\Config\ConfigManager.
*/
namespace Drupal\Core\Config;
use Drupal\Core\Entity\EntityManagerInterface;
use Drupal\Core\Entity\EntityTypeInterface;
use Drupal\Core\StringTranslation\TranslationManager;
use Symfony\Component\Yaml\Dumper;
/**
* The ConfigManager provides helper functions for the configuration system.
*/
class ConfigManager implements ConfigManagerInterface {
/**
* The entity manager.
*
* @var \Drupal\Core\Entity\EntityManagerInterface
*/
protected $entityManager;
/**
* The configuration factory.
*
* @var \Drupal\Core\Config\ConfigFactoryInterface
*/
protected $configFactory;
/**
* The typed config manager.
*
* @var \Drupal\Core\Config\TypedConfigManager
*/
protected $typedConfigManager;
/**
* The string translation service.
*
* @var \Drupal\Core\StringTranslation\TranslationManager
*/
protected $stringTranslation;
/**
* Creates ConfigManager objects.
*
* @param \Drupal\Core\Entity\EntityManagerInterface $entity_manager
* The entity manager.
*/
public function __construct(EntityManagerInterface $entity_manager, ConfigFactoryInterface $config_factory, TypedConfigManager $typed_config_manager, TranslationManager $string_translation) {
$this->entityManager = $entity_manager;
$this->configFactory = $config_factory;
$this->typedConfigManager = $typed_config_manager;
$this->stringTranslation = $string_translation;
}
/**
* {@inheritdoc}
*/
public function getEntityTypeIdByName($name) {
$entities = array_filter($this->entityManager->getDefinitions(), function (EntityTypeInterface $entity_type) use ($name) {
return ($config_prefix = $entity_type->getConfigPrefix()) && strpos($name, $config_prefix . '.') === 0;
});
return key($entities);
}
/**
* {@inheritdoc}
*/
public function getEntityManager() {
return $this->entityManager;
}
/**
* {@inheritdoc}
*/
public function diff(StorageInterface $source_storage, StorageInterface $target_storage, $name) {
// @todo Replace with code that can be autoloaded.
// https://drupal.org/node/2188595
require_once DRUPAL_ROOT . '/core/lib/Drupal/Component/Diff/DiffEngine.php';
// The output should show configuration object differences formatted as YAML.
// But the configuration is not necessarily stored in files. Therefore, they
// need to be read and parsed, and lastly, dumped into YAML strings.
$dumper = new Dumper();
$dumper->setIndentation(2);
$source_data = explode("\n", $dumper->dump($source_storage->read($name), PHP_INT_MAX));
$target_data = explode("\n", $dumper->dump($target_storage->read($name), PHP_INT_MAX));
// Check for new or removed files.
if ($source_data === array('false')) {
// Added file.
$source_data = array($this->stringTranslation->translate('File added'));
}
if ($target_data === array('false')) {
// Deleted file.
$target_data = array($this->stringTranslation->translate('File removed'));
}
return new \Diff($source_data, $target_data);
}
/**
* {@inheritdoc}
*/
function createSnapshot(StorageInterface $source_storage, StorageInterface $snapshot_storage) {
$snapshot_storage->deleteAll();
foreach ($source_storage->listAll() as $name) {
$snapshot_storage->write($name, $source_storage->read($name));
}
}
/**
* Uninstalls the default configuration of a given extension.
*
* @param string $type
* The extension type; e.g., 'module' or 'theme'.
* @param string $name
* The name of the module or theme to install default configuration for.
*/
function uninstall($type, $name) {
$config_names = $this->configFactory->listAll($name . '.');
foreach ($config_names as $config_name) {
$this->configFactory->get($config_name)->delete();
}
$schema_dir = drupal_get_path($type, $name) . '/config/schema';
if (is_dir($schema_dir)) {
// Refresh the schema cache if uninstalling an extension that provides
// configuration schema.
$this->typedConfigManager->clearCachedDefinitions();
}
}
}
<?php
/**
* @file
* Contains \Drupal\Core\Config\ConfigManagerInterface.
*/
namespace Drupal\Core\Config;
/**
* Provides an interface for configuration manager.
*/
interface ConfigManagerInterface {
/**
* Returns the entity type of a configuration object.
*
* @param string $name
* The configuration object name.
*
* @return string|null
* Either the entity type name, or NULL if none match.
*/
function getEntityTypeIdByName($name);
/**
* Gets the entity manager.
*
* @return \Drupal\Core\Entity\EntityManagerInterface
* The entity manager.
*/
public function getEntityManager();
/**
* Return a formatted diff of a named config between two storages.
*
* @param \Drupal\Core\Config\StorageInterface $source_storage
* The storage to diff configuration from.
* @param \Drupal\Core\Config\StorageInterface $target_storage
* The storage to diff configuration to.
* @param string $name
* The name of the configuration object to diff.
*
* @return core/lib/Drupal/Component/Diff
* A formatted string showing the difference between the two storages.
*
* @todo Make renderer injectable
*/
public function diff(StorageInterface $source_storage, StorageInterface $target_storage, $name);
/**
* Creates a configuration snapshot following a successful import.
*
* @param \Drupal\Core\Config\StorageInterface $source_storage
* The storage to synchronize configuration from.
* @param \Drupal\Core\Config\StorageInterface $snapshot_storage
* The storage to synchronize configuration to.
*/
public function createSnapshot(StorageInterface $source_storage, StorageInterface $snapshot_storage);
/**
* Uninstalls the configuration of a given extension.
*
* @param string $type
* The extension type; e.g., 'module' or 'theme'.
* @param string $name
* The name of the module or theme to install configuration for.
*/
public function uninstall($type, $name);
}
......@@ -8,6 +8,7 @@
namespace Drupal\Core\EventSubscriber;
use Drupal\Core\Config\Config;
use Drupal\Core\Config\ConfigManagerInterface;
use Drupal\Core\Config\StorageInterface;
use Drupal\Core\Config\ConfigImporterEvent;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
......@@ -17,6 +18,13 @@
*/
class ConfigSnapshotSubscriber implements EventSubscriberInterface {
/**
* The configuration manager.
*
* @var \Drupal\Core\Config\ConfigManagerInterface
*/
protected $configManager;
/**
* The source storage used to discover configuration changes.
*
......@@ -39,7 +47,8 @@ class ConfigSnapshotSubscriber implements EventSubscriberInterface {
* @param StorageInterface $snapshot_storage
* The snapshot storage used to write configuration changes.
*/
public function __construct(StorageInterface $source_storage, StorageInterface $snapshot_storage) {
public function __construct(ConfigManagerInterface $config_manager, StorageInterface $source_storage, StorageInterface $snapshot_storage) {
$this->configManager = $config_manager;
$this->sourceStorage = $source_storage;
$this->snapshotStorage = $snapshot_storage;
}
......@@ -51,7 +60,7 @@ public function __construct(StorageInterface $source_storage, StorageInterface $
* The Event to process.
*/
public function onConfigImporterImport(ConfigImporterEvent $event) {
config_import_create_snapshot($this->sourceStorage, $this->snapshotStorage);
$this->configManager->createSnapshot($this->sourceStorage, $this->snapshotStorage);
}
/**
......
......@@ -730,7 +730,7 @@ public function uninstall(array $module_list, $uninstall_dependents = TRUE) {
$module_config->clear("enabled.$module")->save();
// Remove all configuration belonging to the module.
config_uninstall_default_config('module', $module);
\Drupal::service('config.manager')->uninstall('module', $module);
// Update the module handler to remove the module.
// The current ModuleHandler instance is obsolete with the kernel rebuild
......
......@@ -8,6 +8,7 @@
namespace Drupal\config\Controller;
use Drupal\Component\Archiver\ArchiveTar;
use Drupal\Core\Config\ConfigManagerInterface;
use Drupal\Core\Config\StorageInterface;
use Drupal\Core\DependencyInjection\ContainerInjectionInterface;
use Drupal\system\FileDownloadController;
......@@ -33,6 +34,13 @@ class ConfigController implements ContainerInjectionInterface {
*/
protected $sourceStorage;
/**
* The configuration manager.
*
* @var \Drupal\Core\Config\ConfigManagerInterface
*/
protected $configManager;
/**
* The file download controller.
*
......@@ -47,6 +55,7 @@ public static function create(ContainerInterface $container) {
return new static(
$container->get('config.storage'),
$container->get('config.storage.staging'),
$container->get('config.manager'),
new FileDownloadController()
);
}
......@@ -61,9 +70,10 @@ public static function create(ContainerInterface $container) {
* @param \Drupal\system\FileDownloadController $file_download_controller
* The file download controller.
*/
public function __construct(StorageInterface $target_storage, StorageInterface $source_storage, FileDownloadController $file_download_controller) {
public function __construct(StorageInterface $target_storage, StorageInterface $source_storage, ConfigManagerInterface $config_manager, FileDownloadController $file_download_controller) {
$this->targetStorage = $target_storage;
$this->sourceStorage = $source_storage;
$this->configManager = $config_manager;
$this->fileDownloadController = $file_download_controller;
}
......@@ -94,7 +104,7 @@ public function downloadExport() {
*/
public function diff($config_file) {
$diff = config_diff($this->targetStorage, $this->sourceStorage, $config_file);
$diff = $this->configManager->diff($this->targetStorage, $this->sourceStorage, $config_file);
$formatter = new \DrupalDiffFormatter();
$formatter->show_header = FALSE;
......
......@@ -7,15 +7,13 @@
namespace Drupal\config\Form;
use Drupal\Component\Uuid\UuidInterface;
use Drupal\Core\Entity\EntityManagerInterface;
use Drupal\Core\Config\ConfigManagerInterface;
use Drupal\Core\Form\FormBase;
use Drupal\Core\Config\StorageInterface;
use Drupal\Core\Lock\LockBackendInterface;
use Drupal\Core\Config\StorageComparer;
use Drupal\Core\Config\ConfigImporter;
use Drupal\Core\Config\ConfigException;
use Drupal\Core\Config\ConfigFactory;
use Drupal\Core\Config\TypedConfigManager;
use Drupal\Core\Routing\UrlGeneratorInterface;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
......@@ -55,9 +53,11 @@ class ConfigSync extends FormBase {
protected $eventDispatcher;
/**
* @var \Drupal\Core\Entity\EntityManagerInterface;
* The configuration manager.
*
* @var \Drupal\Core\Config\ConfigManagerInterface;
*/
protected $entity_manager;
protected $configManager;