You are here

protected function GoogleAnalyticsDate::opSimple in Google Analytics Reports 8.3

Overrides Date::opSimple

File

src/Plugin/views/filter/GoogleAnalyticsDate.php, line 34

Class

GoogleAnalyticsDate
A handler to provide filters for Google Analytics dates.

Namespace

Drupal\google_analytics_reports\Plugin\views\filter

Code

protected function opSimple($field) {
  $origin = !empty($this->value['type']) && $this->value['type'] == 'offset' ? \Drupal::time()
    ->getRequestTime() : 0;
  $value = intval(strtotime($this->value['value'], $origin));
  $this->query
    ->addWhere($this->options['group'], $field, $value, $this->operator);
}