You are here

public function NumericFilter::adminSummary in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/views/src/Plugin/views/filter/NumericFilter.php \Drupal\views\Plugin\views\filter\NumericFilter::adminSummary()

Display the filter on the administrative summary.

Overrides FilterPluginBase::adminSummary

File

core/modules/views/src/Plugin/views/filter/NumericFilter.php, line 380

Class

NumericFilter
Simple filter to handle greater than/less than filters.

Namespace

Drupal\views\Plugin\views\filter

Code

public function adminSummary() {
  if ($this
    ->isAGroup()) {
    return $this
      ->t('grouped');
  }
  if (!empty($this->options['exposed'])) {
    return $this
      ->t('exposed');
  }
  $options = $this
    ->operatorOptions('short');
  $output = $options[$this->operator];
  if (in_array($this->operator, $this
    ->operatorValues(2))) {
    $output .= ' ' . $this
      ->t('@min and @max', [
      '@min' => $this->value['min'],
      '@max' => $this->value['max'],
    ]);
  }
  elseif (in_array($this->operator, $this
    ->operatorValues(1))) {
    $output .= ' ' . $this->value['value'];
  }
  return $output;
}