Project

General

Profile

Paste
Download (949 Bytes) Statistics
| Branch: | Revision:

root / drupal7 / sites / all / modules / views / handlers / views_handler_sort_group_by_numeric.inc @ 8be7bf84

1
<?php
2

    
3
/**
4
 * @file
5
 * Definition of views_handler_sort_group_by_numeric.
6
 */
7

    
8
/**
9
 * Handler for GROUP BY on simple numeric fields.
10
 *
11
 * @ingroup views_sort_handlers
12
 */
13
class views_handler_sort_group_by_numeric extends views_handler_sort {
14

    
15
  /**
16
   * {@inheritdoc}
17
   */
18
  public function init(&$view, &$options) {
19
    parent::init($view, $options);
20

    
21
    // Initialize the original handler.
22
    $this->handler = views_get_handler($options['table'], $options['field'], 'sort');
23
    $this->handler->init($view, $options);
24
  }
25

    
26
  /**
27
   * {@inheritdoc}
28
   */
29
  public function query() {
30
    $this->ensure_my_table();
31

    
32
    $params = array(
33
      'function' => $this->options['group_type'],
34
    );
35

    
36
    $this->query->add_orderby($this->table_alias, $this->real_field, $this->options['order'], NULL, $params);
37
  }
38

    
39
  /**
40
   * {@inheritdoc}
41
   */
42
  public function ui_name($short = FALSE) {
43
    return $this->get_field(parent::ui_name($short));
44
  }
45

    
46
}