You are here

public function RdfMapping::calculateDependencies in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 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 142
Contains \Drupal\rdf\Entity\RdfMapping.

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::entityManager()
    ->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;
}