You are here

public function LingotekFieldDeletedConfigSubscriber::onConfigDelete in Lingotek Translation 8.2

Same name and namespace in other branches
  1. 4.0.x src/EventSubscriber/LingotekFieldDeletedConfigSubscriber.php \Drupal\lingotek\EventSubscriber\LingotekFieldDeletedConfigSubscriber::onConfigDelete()
  2. 3.0.x src/EventSubscriber/LingotekFieldDeletedConfigSubscriber.php \Drupal\lingotek\EventSubscriber\LingotekFieldDeletedConfigSubscriber::onConfigDelete()
  3. 3.1.x src/EventSubscriber/LingotekFieldDeletedConfigSubscriber.php \Drupal\lingotek\EventSubscriber\LingotekFieldDeletedConfigSubscriber::onConfigDelete()
  4. 3.2.x src/EventSubscriber/LingotekFieldDeletedConfigSubscriber.php \Drupal\lingotek\EventSubscriber\LingotekFieldDeletedConfigSubscriber::onConfigDelete()
  5. 3.3.x src/EventSubscriber/LingotekFieldDeletedConfigSubscriber.php \Drupal\lingotek\EventSubscriber\LingotekFieldDeletedConfigSubscriber::onConfigDelete()
  6. 3.4.x src/EventSubscriber/LingotekFieldDeletedConfigSubscriber.php \Drupal\lingotek\EventSubscriber\LingotekFieldDeletedConfigSubscriber::onConfigDelete()
  7. 3.5.x src/EventSubscriber/LingotekFieldDeletedConfigSubscriber.php \Drupal\lingotek\EventSubscriber\LingotekFieldDeletedConfigSubscriber::onConfigDelete()
  8. 3.6.x src/EventSubscriber/LingotekFieldDeletedConfigSubscriber.php \Drupal\lingotek\EventSubscriber\LingotekFieldDeletedConfigSubscriber::onConfigDelete()
  9. 3.7.x src/EventSubscriber/LingotekFieldDeletedConfigSubscriber.php \Drupal\lingotek\EventSubscriber\LingotekFieldDeletedConfigSubscriber::onConfigDelete()
  10. 3.8.x src/EventSubscriber/LingotekFieldDeletedConfigSubscriber.php \Drupal\lingotek\EventSubscriber\LingotekFieldDeletedConfigSubscriber::onConfigDelete()

Updates the Lingotek configuration when a field is deleted.

Parameters

\Drupal\Core\Config\ConfigCrudEvent $event: The configuration event.

File

src/EventSubscriber/LingotekFieldDeletedConfigSubscriber.php, line 48

Class

LingotekFieldDeletedConfigSubscriber
Updates Lingotek config if a field is deleted.

Namespace

Drupal\lingotek\EventSubscriber

Code

public function onConfigDelete(ConfigCrudEvent $event) {
  if (!drupal_installation_attempted()) {
    $config = $event
      ->getConfig();
    if ($config instanceof FieldConfigInterface) {
      $field_name = $config
        ->getName();
      $entity_type_id = $config
        ->getTargetEntityTypeId();
      $bundle = $config
        ->getTargetBundle();
      $this->lingotekConfiguration
        ->setFieldLingotekEnabled($entity_type_id, $bundle, $field_name, FALSE);
    }
  }
}