1
|
<?php
|
2
|
|
3
|
/**
|
4
|
* @file
|
5
|
* Definition of views_handler_filter_ncs_last_updated.
|
6
|
*/
|
7
|
|
8
|
/**
|
9
|
* Filter handler for the newer of last comment / node updated.
|
10
|
*
|
11
|
* @ingroup views_filter_handlers
|
12
|
*/
|
13
|
class views_handler_filter_ncs_last_updated extends views_handler_filter_date {
|
14
|
|
15
|
/**
|
16
|
* {@inheritdoc}
|
17
|
*/
|
18
|
public function query() {
|
19
|
$this->ensure_my_table();
|
20
|
$this->node_table = $this->query->ensure_table('node', $this->relationship);
|
21
|
|
22
|
$field = "GREATEST(" . $this->node_table . ".changed, " . $this->table_alias . ".last_comment_timestamp)";
|
23
|
|
24
|
$info = $this->operators();
|
25
|
if (!empty($info[$this->operator]['method'])) {
|
26
|
$this->{$info[$this->operator]['method']}($field);
|
27
|
}
|
28
|
}
|
29
|
|
30
|
}
|