function EntityActionBase::calculateDependencies

Same name in other branches
  1. 9 core/lib/Drupal/Core/Action/Plugin/Action/EntityActionBase.php \Drupal\Core\Action\Plugin\Action\EntityActionBase::calculateDependencies()
  2. 10 core/lib/Drupal/Core/Action/Plugin/Action/EntityActionBase.php \Drupal\Core\Action\Plugin\Action\EntityActionBase::calculateDependencies()
  3. 11.x core/lib/Drupal/Core/Action/Plugin/Action/EntityActionBase.php \Drupal\Core\Action\Plugin\Action\EntityActionBase::calculateDependencies()

Overrides DependentPluginInterface::calculateDependencies

File

core/lib/Drupal/Core/Action/Plugin/Action/EntityActionBase.php, line 55

Class

EntityActionBase
Base class for entity-based actions.

Namespace

Drupal\Core\Action\Plugin\Action

Code

public function calculateDependencies() {
    $module_name = $this->entityTypeManager
        ->getDefinition($this->getPluginDefinition()['type'])
        ->getProvider();
    return [
        'module' => [
            $module_name,
        ],
    ];
}

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