You are here

public function UninstallValidator::__construct in Lightning Media 8.3

Same name in this branch
  1. 8.3 modules/lightning_media_slideshow/src/UninstallValidator.php \Drupal\lightning_media_slideshow\UninstallValidator::__construct()
  2. 8.3 modules/lightning_media_slideshow/src/ProxyClass/UninstallValidator.php \Drupal\lightning_media_slideshow\ProxyClass\UninstallValidator::__construct()
Same name and namespace in other branches
  1. 8.4 modules/lightning_media_slideshow/src/UninstallValidator.php \Drupal\lightning_media_slideshow\UninstallValidator::__construct()

Constructs a new validator.

Parameters

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

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

File

modules/lightning_media_slideshow/src/UninstallValidator.php, line 32

Class

UninstallValidator
Prevents this module from being uninstalled if any slideshow blocks exist.

Namespace

Drupal\lightning_media_slideshow

Code

public function __construct(EntityTypeManagerInterface $entity_type_manager, TranslationInterface $string_translation) {
  $this->blockContentStorage = $entity_type_manager
    ->getStorage('block_content');
  $this
    ->setStringTranslation($string_translation);
}