function Roles::operators

Same name and namespace in other branches
  1. 9 core/modules/user/src/Plugin/views/filter/Roles.php \Drupal\user\Plugin\views\filter\Roles::operators()
  2. 8.9.x core/modules/user/src/Plugin/views/filter/Roles.php \Drupal\user\Plugin\views\filter\Roles::operators()
  3. 10 core/modules/user/src/Plugin/views/filter/Roles.php \Drupal\user\Plugin\views\filter\Roles::operators()

Override empty and not empty operator labels to be clearer for user roles.

Return value

array[]

Overrides ManyToOne::operators

File

core/modules/user/src/Plugin/views/filter/Roles.php, line 76

Class

Roles
Filter handler for user roles.

Namespace

Drupal\user\Plugin\views\filter

Code

public function operators() {
    $operators = parent::operators();
    $operators['empty']['title'] = $this->t("Only has the 'authenticated user' role");
    $operators['not empty']['title'] = $this->t("Has roles in addition to 'authenticated user'");
    return $operators;
}

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