Version 1
[yaffs-website] / web / core / modules / comment / src / Plugin / views / filter / StatisticsLastUpdated.php
1 <?php
2
3 namespace Drupal\comment\Plugin\views\filter;
4
5 use Drupal\views\Plugin\views\filter\Date;
6
7 /**
8  * Filter handler for the newer of last comment / node updated.
9  *
10  * @ingroup views_filter_handlers
11  *
12  * @ViewsFilter("comment_ces_last_updated")
13  */
14 class StatisticsLastUpdated extends Date {
15
16   public function query() {
17     $this->ensureMyTable();
18     $this->node_table = $this->query->ensureTable('node', $this->relationship);
19
20     $field = "GREATEST(" . $this->node_table . ".changed, " . $this->tableAlias . ".last_comment_timestamp)";
21
22     $info = $this->operators();
23     if (!empty($info[$this->operator]['method'])) {
24       $this->{$info[$this->operator]['method']}($field);
25     }
26   }
27
28 }