function FieldUninstallValidator::__construct

Same name in this branch
  1. 9 core/modules/field/src/ProxyClass/FieldUninstallValidator.php \Drupal\field\ProxyClass\FieldUninstallValidator::__construct()
Same name in other branches
  1. 8.9.x core/modules/field/src/ProxyClass/FieldUninstallValidator.php \Drupal\field\ProxyClass\FieldUninstallValidator::__construct()
  2. 8.9.x core/modules/field/src/FieldUninstallValidator.php \Drupal\field\FieldUninstallValidator::__construct()
  3. 10 core/modules/field/src/ProxyClass/FieldUninstallValidator.php \Drupal\field\ProxyClass\FieldUninstallValidator::__construct()
  4. 10 core/modules/field/src/FieldUninstallValidator.php \Drupal\field\FieldUninstallValidator::__construct()
  5. 11.x core/modules/field/src/ProxyClass/FieldUninstallValidator.php \Drupal\field\ProxyClass\FieldUninstallValidator::__construct()
  6. 11.x core/modules/field/src/FieldUninstallValidator.php \Drupal\field\FieldUninstallValidator::__construct()

Constructs a new FieldUninstallValidator.

Parameters

\Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager: The entity type manager.

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

\Drupal\Core\Field\FieldTypePluginManagerInterface $field_type_manager: The field type plugin manager.

File

core/modules/field/src/FieldUninstallValidator.php, line 43

Class

FieldUninstallValidator
Prevents uninstallation of modules providing active field storage.

Namespace

Drupal\field

Code

public function __construct(EntityTypeManagerInterface $entity_type_manager, TranslationInterface $string_translation, FieldTypePluginManagerInterface $field_type_manager) {
    $this->fieldStorageConfigStorage = $entity_type_manager->getStorage('field_storage_config');
    $this->stringTranslation = $string_translation;
    $this->fieldTypeManager = $field_type_manager;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.