Projet

Général

Profil

Paste
Télécharger (886 octets) Statistiques
| Branche: | Révision:

root / drupal7 / sites / all / modules / views / handlers / views_handler_sort_group_by_numeric.inc @ 7547bb19

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
  function init(&$view, &$options) {
15
    parent::init($view, $options);
16

    
17
    // Initialize the original handler.
18
    $this->handler = views_get_handler($options['table'], $options['field'], 'sort');
19
    $this->handler->init($view, $options);
20
  }
21

    
22
  /**
23
   * Called to add the field to a query.
24
   */
25
  function query() {
26
    $this->ensure_my_table();
27

    
28
    $params = array(
29
      'function' => $this->options['group_type'],
30
    );
31

    
32
    $this->query->add_orderby($this->table_alias, $this->real_field, $this->options['order'], NULL, $params);
33
  }
34

    
35
  function ui_name($short = FALSE) {
36
    return $this->get_field(parent::ui_name($short));
37
  }
38
}