function ContentLanguageSettings::calculateDependencies

Same name in other branches
  1. 9 core/modules/language/src/Entity/ContentLanguageSettings.php \Drupal\language\Entity\ContentLanguageSettings::calculateDependencies()
  2. 8.9.x core/modules/language/src/Entity/ContentLanguageSettings.php \Drupal\language\Entity\ContentLanguageSettings::calculateDependencies()
  3. 11.x core/modules/language/src/Entity/ContentLanguageSettings.php \Drupal\language\Entity\ContentLanguageSettings::calculateDependencies()

Overrides ConfigEntityBase::calculateDependencies

File

core/modules/language/src/Entity/ContentLanguageSettings.php, line 209

Class

ContentLanguageSettings
Defines the ContentLanguageSettings entity.

Namespace

Drupal\language\Entity

Code

public function calculateDependencies() {
    parent::calculateDependencies();
    // Create dependency on the bundle.
    $entity_type = \Drupal::entityTypeManager()->getDefinition($this->target_entity_type_id);
    $bundle_config_dependency = $entity_type->getBundleConfigDependency($this->target_bundle);
    $this->addDependency($bundle_config_dependency['type'], $bundle_config_dependency['name']);
    return $this;
}

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