/[drupal]/contributions/modules/views/handlers/views_handler_sort_group_by_numeric.inc
ViewVC logotype

Diff of /contributions/modules/views/handlers/views_handler_sort_group_by_numeric.inc

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.1, Tue Nov 10 23:23:27 2009 UTC revision 1.1.2.1, Tue Nov 10 23:23:27 2009 UTC
# Line 0  Line 1 
1    <?php
2    // $Id: views_handler_sort.inc,v 1.14.2.20 2009/11/02 23:31:14 merlinofchaos Exp $
3    /**
4     * Handler for GROUP BY on simple numeric fields.
5     */
6    class views_handler_sort_group_by_numeric extends views_handler_sort {
7      function init(&$view, $options) {
8        parent::init($view, $options);
9    
10        // Initialize the original handler.
11        $this->handler = views_get_handler($options['table'], $options['field'], 'sort');
12        $this->handler->init($view, $options);
13      }
14    
15      /**
16       * Called to add the field to a query.
17       */
18      function query() {
19        $params = array(
20          'function' => $this->options['group_type'],
21        );
22    
23        $this->query->add_orderby($this->table, $this->field, $this->options['order'], NULL, $params);
24      }
25    
26      function ui_name() {
27        return $this->get_field(parent::ui_name());
28      }
29    }

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.1.2.1

  ViewVC Help
Powered by ViewVC 1.1.2