You are here

function date_views_argument_handler::get_query_fields in Date 8

Same name and namespace in other branches
  1. 7.3 date_views/includes/date_views_argument_handler.inc \date_views_argument_handler::get_query_fields()
  2. 7 date_views/includes/date_views_argument_handler.inc \date_views_argument_handler::get_query_fields()
  3. 7.2 date_views/includes/date_views_argument_handler.inc \date_views_argument_handler::get_query_fields()

Collect information about our fields we will need to create the right query.

1 call to date_views_argument_handler::get_query_fields()
date_views_argument_handler::query in date_views/includes/date_views_argument_handler.inc
Set up the query for this argument.

File

date_views/includes/date_views_argument_handler.inc, line 184
Date API views argument handler. This argument combines multiple date arguments into a single argument where all fields are controlled by the same date and can be combined with either AND or OR.

Class

date_views_argument_handler
Date API argument handler.

Code

function get_query_fields() {
  $fields = date_views_fields($this->base_table);
  $fields = $fields['name'];
  $this->query_fields = array();
  foreach ($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']);
      date_views_set_timezone($date_handler, $this, $field);
      $this->query_fields[] = array(
        'field' => $field,
        'date_handler' => $date_handler,
      );
    }
  }
}