Révision 5d12d676
Ajouté par Assos Assos il y a environ 6 ans
drupal7/sites/all/modules/views/modules/node/views_handler_filter_node_version_count.inc | ||
---|---|---|
1 | 1 |
<?php |
2 | 2 |
|
3 |
/** |
|
4 |
* @file |
|
5 |
* Definition of views_handler_filter_node_version_count. |
|
6 |
*/ |
|
7 |
|
|
3 | 8 |
/** |
4 | 9 |
* Filter to handle dates stored as a timestamp. |
5 | 10 |
* |
6 | 11 |
* @ingroup views_filter_handlers |
7 | 12 |
*/ |
8 | 13 |
class views_handler_filter_node_version_count extends views_handler_filter_numeric { |
9 |
function op_between($field) { |
|
14 |
|
|
15 |
/** |
|
16 |
* {@inheritdoc} |
|
17 |
*/ |
|
18 |
public function op_between($field) { |
|
10 | 19 |
if ($this->operator == 'between') { |
11 | 20 |
$this->query->add_where_expression($this->options['group'], '(SELECT COUNT(vid) FROM {node_revision} WHERE nid = {' . $this->table_alias . '}.nid) BETWEEN :min AND :max', array(':min' => $this->value['min'], ':max' => $this->value['max'])); |
12 | 21 |
} |
... | ... | |
15 | 24 |
} |
16 | 25 |
} |
17 | 26 |
|
18 |
function op_simple($field) { |
|
27 |
/** |
|
28 |
* {@inheritdoc} |
|
29 |
*/ |
|
30 |
public function op_simple($field) { |
|
19 | 31 |
$this->query->add_where_expression($this->options['group'], '(SELECT COUNT(vid) FROM {node_revision} WHERE nid = {' . $this->table_alias . '}.nid)' . $this->operator . ' :value', array(':value' => $this->value['value'])); |
20 | 32 |
} |
21 | 33 |
|
22 |
function op_empty($field) { |
|
34 |
/** |
|
35 |
* {@inheritdoc} |
|
36 |
*/ |
|
37 |
public function op_empty($field) { |
|
23 | 38 |
if ($this->operator == 'empty') { |
24 | 39 |
$operator = "IS NULL"; |
25 | 40 |
} |
... | ... | |
30 | 45 |
$this->query->add_where_expression($this->options['group'], '(SELECT COUNT(vid) FROM {node_revision} WHERE nid = {' . $this->table_alias . '}.nid) ' . $this->operator); |
31 | 46 |
} |
32 | 47 |
|
33 |
function op_regex($field) { |
|
48 |
/** |
|
49 |
* {@inheritdoc} |
|
50 |
*/ |
|
51 |
public function op_regex($field) { |
|
34 | 52 |
$this->query->add_where_expression($this->options['group'], '(SELECT COUNT(vid) FROM {node_revision} WHERE nid = {' . $this->table_alias . '}.nid) RLIKE :value', array(':value' => $this->value['value'])); |
35 | 53 |
} |
54 |
|
|
36 | 55 |
} |
Formats disponibles : Unified diff
Weekly update of contrib modules