You are here

public function Name::adminSummary in Views (for Drupal 7) 8.3

Display the filter on the administrative summary

Overrides InOperator::adminSummary

File

lib/Views/user/Plugin/views/filter/Name.php, line 154
Definition of Views\user\Plugin\views\filter\Name.

Class

Name
Filter handler for usernames.

Namespace

Views\user\Plugin\views\filter

Code

public function adminSummary() {

  // set up $this->value_options for the parent summary
  $this->value_options = array();
  if ($this->value) {
    $result = entity_load_multiple_by_properties('user', array(
      'uid' => $this->value,
    ));
    foreach ($result as $account) {
      if ($account->uid) {
        $this->value_options[$account->uid] = $account->name;
      }
      else {
        $this->value_options[$account->uid] = 'Anonymous';

        // Intentionally NOT translated.
      }
    }
  }
  return parent::adminSummary();
}