You are here

public function Roles::operators in Drupal 10

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

Overrides ManyToOne::operators

File

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

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;
}