function LanguageHooks::entityBundleDelete

Implements hook_entity_bundle_delete().

Attributes

#[Hook('entity_bundle_delete')]

File

core/modules/language/src/Hook/LanguageHooks.php, line 216

Class

LanguageHooks
Hook implementations for language.

Namespace

Drupal\language\Hook

Code

public function entityBundleDelete($entity_type_id, $bundle) : void {
  // Remove the content language settings associated with the bundle.
  $settings = ContentLanguageSettings::loadByEntityTypeBundle($entity_type_id, $bundle);
  if (!$settings->isNew()) {
    $settings->delete();
  }
}

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