You are here

function date_views_filter_handler::get_query_fields in Date 8

Same name and namespace in other branches
  1. 7.3 date_views/includes/date_views_filter_handler.inc \date_views_filter_handler::get_query_fields()
  2. 7 date_views/includes/date_views_filter_handler.inc \date_views_filter_handler::get_query_fields()
  3. 7.2 date_views/includes/date_views_filter_handler.inc \date_views_filter_handler::get_query_fields()
1 call to date_views_filter_handler::get_query_fields()
date_views_filter_handler::date_combine_conditions in date_views/includes/date_views_filter_handler.inc
Combines multiple date WHERE expressions into a single WHERE expression.

File

date_views/includes/date_views_filter_handler.inc, line 163
A flexible, configurable date filter. This filter combines multiple date filters into a single filter where all fields are controlled by the same date and can be combined with either AND or OR.

Class

date_views_filter_handler
@file A flexible, configurable date filter. This filter combines multiple date filters into a single filter where all fields are controlled by the same date and can be combined with either AND or OR.

Code

function get_query_fields() {
  $fields = date_views_fields($this->base_table);
  $fields = $fields['name'];
  $this->query_fields = array();
  foreach ((array) $this->options['date_fields'] as $delta => $name) {
    if (array_key_exists($name, $fields) && ($field = $fields[$name])) {
      $date_handler = new DateSqlHandler($field['sql_type'], drupal_get_user_timezone());
      $date_handler->granularity = $this->options['granularity'];
      $date_handler->db_timezone = date_get_timezone_db($field['tz_handling']);
      $date_handler->local_timezone = date_get_timezone($field['tz_handling']);
      $this->query_fields[] = array(
        'field' => $field,
        'date_handler' => $date_handler,
      );
    }
  }
}