You are here

public function ContentLanguageSettings::calculateDependencies in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/language/src/Entity/ContentLanguageSettings.php \Drupal\language\Entity\ContentLanguageSettings::calculateDependencies()

Calculates dependencies and stores them in the dependency property.

Return value

$this

Overrides ConfigEntityBase::calculateDependencies

See also

\Drupal\Core\Config\Entity\ConfigDependencyManager

File

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

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;
}