function Uid::title_query in Views (for Drupal 7) 8.3
Override the behavior of title(). Get the name of the user.
Return value
array A list of usernames.
Overrides Numeric::title_query
File
- lib/
Views/ user/ Plugin/ views/ argument/ Uid.php, line 31 - Definition of Views\user\Plugin\views\argument\Uid.
Class
- Uid
- Argument handler to accept a user id.
Namespace
Views\user\Plugin\views\argumentCode
function title_query() {
if (!$this->argument) {
return array(
config('user.settings')
->get('anonymous'),
);
}
$titles = array();
$users = user_load_multiple($this->value);
foreach ($users as $account) {
$titles[] = check_plain($account
->label());
}
return $titles;
}