You are here

public function User::calculateDependencies in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/user/src/Plugin/views/argument_validator/User.php \Drupal\user\Plugin\views\argument_validator\User::calculateDependencies()
  2. 9 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;
}