public function EntityDisplayModeBase::calculateDependencies

public EntityDisplayModeBase::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/lib/Drupal/Core/Entity/EntityDisplayModeBase.php, line 87

Class

EntityDisplayModeBase
Base class for config entity types with settings for form and view modes.

Namespace

Drupal\Core\Entity

Code

public function calculateDependencies() {
  parent::calculateDependencies();
  $target_entity_type = \Drupal::entityManager()->getDefinition($this->targetEntityType);
  $this->addDependency('module', $target_entity_type->getProvider());
  return $this;
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Entity!EntityDisplayModeBase.php/function/EntityDisplayModeBase::calculateDependencies/8.1.x