| 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 |
|
} |