diff --git a/core/lib/Drupal/Core/Config/ConfigImporter.php b/core/lib/Drupal/Core/Config/ConfigImporter.php index 7da2f8a..92476b5 100644 --- a/core/lib/Drupal/Core/Config/ConfigImporter.php +++ b/core/lib/Drupal/Core/Config/ConfigImporter.php @@ -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\ConfigFactoryInterface + * @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(). @@ -89,20 +86,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. * * @param \Drupal\Core\Config\StorageComparerInterface $storage_comparer @@ -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\ConfigFactoryInterface $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, ConfigFactoryInterface $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);