function Role::calculateDependencies

Same name in this branch
  1. 9 core/modules/user/src/Entity/Role.php \Drupal\user\Entity\Role::calculateDependencies()
Same name in other branches
  1. 8.9.x core/modules/user/src/Plugin/views/access/Role.php \Drupal\user\Plugin\views\access\Role::calculateDependencies()
  2. 10 core/modules/user/src/Entity/Role.php \Drupal\user\Entity\Role::calculateDependencies()
  3. 10 core/modules/user/src/Plugin/views/access/Role.php \Drupal\user\Plugin\views\access\Role::calculateDependencies()
  4. 11.x core/modules/user/src/Entity/Role.php \Drupal\user\Entity\Role::calculateDependencies()
  5. 11.x core/modules/user/src/Plugin/views/access/Role.php \Drupal\user\Plugin\views\access\Role::calculateDependencies()

Overrides PluginBase::calculateDependencies

File

core/modules/user/src/Plugin/views/access/Role.php, line 131

Class

Role
Access plugin that provides role-based access control.

Namespace

Drupal\user\Plugin\views\access

Code

public function calculateDependencies() {
    $dependencies = parent::calculateDependencies();
    foreach (array_keys($this->options['role']) as $rid) {
        if ($role = $this->roleStorage
            ->load($rid)) {
            $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.