summaryrefslogtreecommitdiffstats
path: root/core/modules/user/lib/Drupal/user/Plugin/views/argument/RolesRid.php
blob: da3bd92d70fa2eb95765597a9a7bc911c86847b1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php

/**
 * @file
 * Definition of views_handler_argument_users_roles_rid.
 */

namespace Drupal\user\Plugin\views\argument;

use Drupal\Core\Annotation\Plugin;
use Drupal\views\Plugin\views\argument\ManyToOne;

/**
 * Allow role ID(s) as argument.
 *
 * @ingroup views_argument_handlers
 *
 * @Plugin(
 *   id = "users_roles_rid",
 *   module = "user"
 * )
 */
class RolesRid extends ManyToOne {

  function title_query() {
    return array(entity_load('user_role', $this->value)->label());
  }

}