function Name::adminSummary
Same name in other branches
- 9 core/modules/user/src/Plugin/views/filter/Name.php \Drupal\user\Plugin\views\filter\Name::adminSummary()
- 8.9.x core/modules/user/src/Plugin/views/filter/Name.php \Drupal\user\Plugin\views\filter\Name::adminSummary()
- 10 core/modules/user/src/Plugin/views/filter/Name.php \Drupal\user\Plugin\views\filter\Name::adminSummary()
Overrides InOperator::adminSummary
File
-
core/
modules/ user/ src/ Plugin/ views/ filter/ Name.php, line 112
Class
- Name
- Filter handler for usernames.
Namespace
Drupal\user\Plugin\views\filterCode
public function adminSummary() {
// Set up $this->valueOptions for the parent summary
$this->valueOptions = [];
if ($this->value) {
$result = \Drupal::entityTypeManager()->getStorage('user')
->loadByProperties([
'uid' => $this->value,
]);
foreach ($result as $account) {
if ($account->id()) {
$this->valueOptions[$account->id()] = $account->label();
}
else {
// Intentionally NOT translated.
$this->valueOptions[$account->id()] = 'Anonymous';
}
}
}
return parent::adminSummary();
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.