public function NcsLastUpdated::query in Views (for Drupal 7) 8.3
Same name in this branch
- 8.3 lib/Views/comment/Plugin/views/filter/NcsLastUpdated.php \Views\comment\Plugin\views\filter\NcsLastUpdated::query()
- 8.3 lib/Views/comment/Plugin/views/sort/NcsLastUpdated.php \Views\comment\Plugin\views\sort\NcsLastUpdated::query()
- 8.3 lib/Views/comment/Plugin/views/field/NcsLastUpdated.php \Views\comment\Plugin\views\field\NcsLastUpdated::query()
Called to add the sort to a query.
Overrides Date::query
File
- lib/
Views/ comment/ Plugin/ views/ sort/ NcsLastUpdated.php, line 25 - Definition of Views\comment\Plugin\views\sort\NcsLastUpdated.
Class
- NcsLastUpdated
- Sort handler for the newer of last comment / node updated.
Namespace
Views\comment\Plugin\views\sortCode
public function query() {
$this
->ensureMyTable();
$this->node_table = $this->query
->ensure_table('node', $this->relationship);
$this->field_alias = $this->query
->add_orderby(NULL, "GREATEST(" . $this->node_table . ".changed, " . $this->tableAlias . ".last_comment_timestamp)", $this->options['order'], $this->tableAlias . '_' . $this->field);
}