You are here

commerce_reports_handler_field_timestamp_ccyymmdd.inc in Commerce Reporting 7.2

File

includes/views/commerce_reports_handler_field_timestamp_ccyymmdd.inc
View source
<?php

/**
 * Create a CCYY-MM-DD field so that we can count product orders by day.
 */
class commerce_reports_handler_field_timestamp_ccyymmdd extends views_handler_field {
  function query() {
    $this
      ->ensure_my_table();
    $params = $this->options['group_type'] != 'group' ? array(
      'function' => $this->options['group_type'],
    ) : array();
    $field_name = views_date_sql_format('Y-m-d', $this->table_alias . '.' . $this->real_field);
    $alias = sprintf("%s_%s_timestamp_ccyymmdd", $this->table_alias, $this->real_field);
    $this->field_alias = $this->query
      ->add_field(NULL, $field_name, $alias, $params);
    $this->query
      ->add_groupby($alias);

    // This seems unnecessary
    $this
      ->add_additional_fields();
  }

}

Classes

Namesort descending Description
commerce_reports_handler_field_timestamp_ccyymmdd Create a CCYY-MM-DD field so that we can count product orders by day.