function UserStorage::deleteRoleReferences

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

Overrides UserStorageInterface::deleteRoleReferences

File

core/modules/user/src/UserStorage.php, line 70

Class

UserStorage
Controller class for users.

Namespace

Drupal\user

Code

public function deleteRoleReferences(array $rids) {
    // Remove the role from all users.
    $this->database
        ->delete('user__roles')
        ->condition('roles_target_id', $rids, 'IN')
        ->execute();
    $this->resetCache();
}

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