public function revisioning_handler_filter_revision_latest_published::query in Revisioning 8
Same name and namespace in other branches
- 7 views/revisioning_handler_filter_revision_latest_published.inc \revisioning_handler_filter_revision_latest_published::query()
Override the query, in particular the WHERE clause.
File
- views/
revisioning_handler_filter_revision_latest_published.inc, line 52 - Views filter to display in a 'Content revisions' view only the latest revision of each node. Does not work in a standard 'Content' view.
Class
- revisioning_handler_filter_revision_latest_published
- @file Views filter to display in a 'Content revisions' view only the latest revision of each node. Does not work in a standard 'Content' view.
Code
public function query() {
$revisions_table = $this
->ensure_my_table();
$node_table = $this->query
->ensure_table('node');
$where_clause = "{$node_table}.vid = {$revisions_table}.vid AND {$node_table}.status=1";
$this->query
->add_where_expression($this->options['group'], $where_clause);
}