function Editor::calculateDependencies
Same name and namespace in other branches
- 11.x core/modules/editor/src/Entity/Editor.php \Drupal\editor\Entity\Editor::calculateDependencies()
- 10 core/modules/editor/src/Entity/Editor.php \Drupal\editor\Entity\Editor::calculateDependencies()
- 9 core/modules/editor/src/Entity/Editor.php \Drupal\editor\Entity\Editor::calculateDependencies()
- 8.9.x core/modules/editor/src/Entity/Editor.php \Drupal\editor\Entity\Editor::calculateDependencies()
Overrides ConfigEntityBase::calculateDependencies
File
-
core/
modules/ editor/ src/ Entity/ Editor.php, line 127
Class
- Editor
- Defines the configured text editor entity.
Namespace
Drupal\editor\EntityCode
public function calculateDependencies() {
parent::calculateDependencies();
// Create a dependency on the associated FilterFormat.
$text_format = $this->getFilterFormat();
if ($text_format) {
$this->addDependency('config', $text_format->getConfigDependencyName());
}
else {
trigger_error("The editor {$this->id()} is configured for text format {$this->id()} which does not exist. Review whether it is still needed and delete if not.", E_USER_WARNING);
}
// @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;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.