3 namespace Drupal\comment\Plugin\views\sort;
5 use Drupal\views\Plugin\views\sort\Date;
8 * Sort handler for the newer of last comment / entity updated.
10 * @ingroup views_sort_handlers
12 * @ViewsSort("comment_ces_last_updated")
14 class StatisticsLastUpdated extends Date {
16 public function query() {
17 $this->ensureMyTable();
18 $this->node_table = $this->query->ensureTable('node', $this->relationship);
19 $this->field_alias = $this->query->addOrderBy(NULL, "GREATEST(" . $this->node_table . ".changed, " . $this->tableAlias . ".last_comment_timestamp)", $this->options['order'], $this->tableAlias . '_' . $this->field);