You are here

public function Editor::calculateDependencies in Drupal 8

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

Class

Editor
Defines the configured text editor entity.

Namespace

Drupal\editor\Entity

Code

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

  // Create a dependency on the associated FilterFormat.
  $this
    ->addDependency('config', $this
    ->getFilterFormat()
    ->getConfigDependencyName());

  // @todo use EntityWithPluginCollectionInterface so configuration between
  //   config entity and dependency on provider is managed automatically.
  $definition = $this
    ->editorPluginManager()
    ->createInstance($this->editor)
    ->getPluginDefinition();
  $this
    ->addDependency('module', $definition['provider']);
  return $this;
}