public function Roles::operators in Drupal 10
Same name and namespace in other branches
- 8 core/modules/user/src/Plugin/views/filter/Roles.php \Drupal\user\Plugin\views\filter\Roles::operators()
- 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\filterCode
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;
}