function ChangeUserRoleBase::calculateDependencies

Same name in other branches
  1. 9 core/modules/user/src/Plugin/Action/ChangeUserRoleBase.php \Drupal\user\Plugin\Action\ChangeUserRoleBase::calculateDependencies()
  2. 8.9.x core/modules/user/src/Plugin/Action/ChangeUserRoleBase.php \Drupal\user\Plugin\Action\ChangeUserRoleBase::calculateDependencies()
  3. 10 core/modules/user/src/Plugin/Action/ChangeUserRoleBase.php \Drupal\user\Plugin\Action\ChangeUserRoleBase::calculateDependencies()

Overrides ConfigurableActionBase::calculateDependencies

File

core/modules/user/src/Plugin/Action/ChangeUserRoleBase.php, line 86

Class

ChangeUserRoleBase
Provides a base class for operations to change a user's role.

Namespace

Drupal\user\Plugin\Action

Code

public function calculateDependencies() {
    if (!empty($this->configuration['rid'])) {
        $prefix = $this->entityType
            ->getConfigPrefix() . '.';
        $this->addDependency('config', $prefix . $this->configuration['rid']);
    }
    return $this->dependencies;
}

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