function CommentDefaultFormatter::calculateDependencies
Overrides PluginSettingsBase::calculateDependencies
File
-
core/
modules/ comment/ src/ Plugin/ Field/ FieldFormatter/ CommentDefaultFormatter.php, line 265
Class
- CommentDefaultFormatter
- Provides a default comment formatter.
Namespace
Drupal\comment\Plugin\Field\FieldFormatterCode
public function calculateDependencies() {
$dependencies = parent::calculateDependencies();
if ($mode = $this->getSetting('view_mode')) {
if ($bundle = $this->getFieldSetting('comment_type')) {
/** @var \Drupal\Core\Entity\Display\EntityViewDisplayInterface $display */
if ($display = EntityViewDisplay::load("comment.{$bundle}.{$mode}")) {
$dependencies[$display->getConfigDependencyKey()][] = $display->getConfigDependencyName();
}
}
}
return $dependencies;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.