You are here

public function DateRange::title in Views Contextual Range Filter 8

Title override.

Required because of range version of views_break_phrase() in this function.

Overrides ArgumentPluginBase::title

File

src/Plugin/views/argument/DateRange.php, line 131

Class

DateRange
Argument handler to accept a date range.

Namespace

Drupal\contextual_range_filter\Plugin\views\argument

Code

public function title() {
  if (!$this->argument) {
    return $this->definition['empty field name'] ?: t('Uncategorized');
  }
  if (!empty($this->options['break_phrase'])) {
    $this
      ->breakPhraseRange($this->argument);
  }
  else {
    $this->value = [
      $this->argument,
    ];
    $this->operator = 'or';
  }
  if ($this->value === FALSE) {
    return $this->definition['invalid input'] ?: t('Invalid input');
  }
  if (empty($this->value)) {
    return $this->definition['empty field name'] ?: t('Uncategorized');
  }
  return implode($this->operator == 'or' ? ' + ' : ', ', $this->value);
}