You are here

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

Prepare the range query where clause.

Parameters

bool $group_by: Whether to apply grouping.

Overrides Formula::query

File

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

Class

DateRange
Argument handler to accept a date range.

Namespace

Drupal\contextual_range_filter\Plugin\views\argument

Code

public function query($group_by = FALSE) {
  $this
    ->ensureMyTable();
  if (!empty($this->options['break_phrase'])) {

    // From "Allow multple ranges" checkbox.
    $this
      ->breakPhraseRange($this->argument);
  }
  else {
    $this->value = [
      $this->argument,
    ];
  }
  $formula = $this
    ->getFormula();
  $range_conversion = empty($this->options['relative_dates']) ? NULL : [
    $this,
    'convertRelativeDateRange',
  ];
  ContextualRangeFilter::buildRangeQuery($this, $formula, $range_conversion);
}