1
|
<?php
|
2
|
|
3
|
/**
|
4
|
* @file
|
5
|
* Definition of views_handler_argument_group_by_numeric.
|
6
|
*/
|
7
|
|
8
|
/**
|
9
|
* Simple handler for arguments using group by.
|
10
|
*
|
11
|
* @ingroup views_argument_handlers
|
12
|
*/
|
13
|
class views_handler_argument_group_by_numeric extends views_handler_argument {
|
14
|
|
15
|
/**
|
16
|
* {@inheritdoc}
|
17
|
*/
|
18
|
public function query($group_by = FALSE) {
|
19
|
$this->ensure_my_table();
|
20
|
$field = $this->get_field();
|
21
|
$placeholder = $this->placeholder();
|
22
|
|
23
|
$this->query->add_having_expression(0, "$field = $placeholder", array($placeholder => $this->argument));
|
24
|
}
|
25
|
|
26
|
/**
|
27
|
* {@inheritdoc}
|
28
|
*/
|
29
|
public function ui_name($short = FALSE) {
|
30
|
return $this->get_field(parent::ui_name($short));
|
31
|
}
|
32
|
|
33
|
/**
|
34
|
* {@inheritdoc}
|
35
|
*/
|
36
|
public function get_sort_name() {
|
37
|
return t('Numerical', array(), array('context' => 'Sort order'));
|
38
|
}
|
39
|
|
40
|
}
|