You are here

public function FieldUninstallValidator::__construct in Zircon Profile 8

Same name in this branch
  1. 8 core/modules/field/src/FieldUninstallValidator.php \Drupal\field\FieldUninstallValidator::__construct()
  2. 8 core/modules/field/src/ProxyClass/FieldUninstallValidator.php \Drupal\field\ProxyClass\FieldUninstallValidator::__construct()
Same name and namespace in other branches
  1. 8.0 core/modules/field/src/FieldUninstallValidator.php \Drupal\field\FieldUninstallValidator::__construct()

Constructs a new FieldUninstallValidator.

Parameters

\Drupal\Core\Entity\EntityManagerInterface $entity_manager: The entity manager.

\Drupal\Core\StringTranslation\TranslationInterface $string_translation: The string translation service.

File

core/modules/field/src/FieldUninstallValidator.php, line 37
Contains \Drupal\field\FieldUninstallValidator.

Class

FieldUninstallValidator
Prevents uninstallation of modules providing active field storage.

Namespace

Drupal\field

Code

public function __construct(EntityManagerInterface $entity_manager, TranslationInterface $string_translation) {
  $this->fieldStorageConfigStorage = $entity_manager
    ->getStorage('field_storage_config');
  $this->stringTranslation = $string_translation;
}