You are here

public function RdfMapping::calculateDependencies in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/rdf/src/Entity/RdfMapping.php \Drupal\rdf\Entity\RdfMapping::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/rdf/src/Entity/RdfMapping.php, line 144

Class

RdfMapping
Config entity for working with RDF mappings.

Namespace

Drupal\rdf\Entity

Code

public function calculateDependencies() {
  parent::calculateDependencies();

  // Create dependency on the bundle.
  $entity_type = \Drupal::entityTypeManager()
    ->getDefinition($this->targetEntityType);
  $this
    ->addDependency('module', $entity_type
    ->getProvider());
  $bundle_config_dependency = $entity_type
    ->getBundleConfigDependency($this->bundle);
  $this
    ->addDependency($bundle_config_dependency['type'], $bundle_config_dependency['name']);
  return $this;
}