function RolesRid::title_query in Views (for Drupal 7) 8.3
Override for specific title lookups.
Overrides ManyToOne::title_query
File
- lib/
Views/ user/ Plugin/ views/ argument/ RolesRid.php, line 25 - Definition of views_handler_argument_users_roles_rid.
Class
- RolesRid
- Allow role ID(s) as argument.
Namespace
Views\user\Plugin\views\argumentCode
function title_query() {
$titles = array();
$query = db_select('role', 'r');
$query
->addField('r', 'name');
$query
->condition('r.rid', $this->value);
$result = $query
->execute();
foreach ($result as $term) {
$titles[] = check_plain($term->name);
}
return $titles;
}