function PluginSettingsBase::calculateDependencies

Same name in other branches
  1. 9 core/lib/Drupal/Core/Field/PluginSettingsBase.php \Drupal\Core\Field\PluginSettingsBase::calculateDependencies()
  2. 8.9.x core/lib/Drupal/Core/Field/PluginSettingsBase.php \Drupal\Core\Field\PluginSettingsBase::calculateDependencies()
  3. 11.x core/lib/Drupal/Core/Field/PluginSettingsBase.php \Drupal\Core\Field\PluginSettingsBase::calculateDependencies()

Overrides DependentPluginInterface::calculateDependencies

6 methods override PluginSettingsBase::calculateDependencies()
CommentDefaultFormatter::calculateDependencies in core/modules/comment/src/Plugin/Field/FieldFormatter/CommentDefaultFormatter.php
Calculates dependencies for the configured plugin.
ImageFormatter::calculateDependencies in core/modules/image/src/Plugin/Field/FieldFormatter/ImageFormatter.php
Calculates dependencies for the configured plugin.
ImageWidget::calculateDependencies in core/modules/image/src/Plugin/Field/FieldWidget/ImageWidget.php
Calculates dependencies for the configured plugin.
ModerationStateWidget::calculateDependencies in core/modules/content_moderation/src/Plugin/Field/FieldWidget/ModerationStateWidget.php
Calculates dependencies for the configured plugin.
ResponsiveImageFormatter::calculateDependencies in core/modules/responsive_image/src/Plugin/Field/FieldFormatter/ResponsiveImageFormatter.php
Calculates dependencies for the configured plugin.

... See full list

File

core/lib/Drupal/Core/Field/PluginSettingsBase.php, line 140

Class

PluginSettingsBase
Base class for the Field API plugins.

Namespace

Drupal\Core\Field

Code

public function calculateDependencies() {
    if (!empty($this->thirdPartySettings)) {
        // Create dependencies on any modules providing third party settings.
        return [
            'module' => array_keys($this->thirdPartySettings),
        ];
    }
    return [];
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.