function User::calculateDependencies

Same name in other branches
  1. 8.9.x core/modules/user/src/Plugin/views/argument_validator/User.php \Drupal\user\Plugin\views\argument_validator\User::calculateDependencies()
  2. 10 core/modules/user/src/Plugin/views/argument_validator/User.php \Drupal\user\Plugin\views\argument_validator\User::calculateDependencies()
  3. 11.x core/modules/user/src/Plugin/views/argument_validator/User.php \Drupal\user\Plugin\views\argument_validator\User::calculateDependencies()

Overrides Entity::calculateDependencies

File

core/modules/user/src/Plugin/views/argument_validator/User.php, line 103

Class

User
Validate whether an argument is a valid user.

Namespace

Drupal\user\Plugin\views\argument_validator

Code

public function calculateDependencies() {
    $dependencies = parent::calculateDependencies();
    foreach ($this->entityTypeManager
        ->getStorage('user_role')
        ->loadMultiple(array_keys($this->options['roles'])) as $role) {
        $dependencies[$role->getConfigDependencyKey()][] = $role->getConfigDependencyName();
    }
    return $dependencies;
}

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