You are here

function views_handler_argument_node_uid_revision::query in Views (for Drupal 7) 6.3

Same name and namespace in other branches
  1. 7.3 modules/node/views_handler_argument_node_uid_revision.inc \views_handler_argument_node_uid_revision::query()

Set up the query for this argument.

The argument sent may be found at $this->argument.

Overrides views_handler_argument_comment_user_uid::query

File

modules/node/views_handler_argument_node_uid_revision.inc, line 9

Class

views_handler_argument_node_uid_revision
Filter handler to accept a user id to check for nodes that user posted or created a revision on.

Code

function query($group_by = FALSE) {
  $this
    ->ensure_my_table();
  $this->query
    ->add_where(0, "{$this->table_alias}.uid = %d OR ((SELECT COUNT(*) FROM {node_revisions} nr WHERE nr.uid = %d AND nr.nid = {$this->table_alias}.nid) > 0)", $this->argument, $this->argument);
}