views_handler_argument_node_uid_revision.inc

Defintion of views_handler_argument_node_uid_revision.

File

modules/node/views_handler_argument_node_uid_revision.inc
View source
  1. <?php
  2. /**
  3. * @file
  4. * Defintion of views_handler_argument_node_uid_revision.
  5. */
  6. /**
  7. * Filter handler to accept a user id to check for nodes that
  8. * user posted or created a revision on.
  9. */
  10. class views_handler_argument_node_uid_revision extends views_handler_argument_comment_user_uid {
  11. function query($group_by = FALSE) {
  12. $this->ensure_my_table();
  13. $placeholder = $this->placeholder();
  14. $this->query->add_where_expression(0, "$this->table_alias.uid = $placeholder OR ((SELECT COUNT(*) FROM {node_revision} nr WHERE nr.uid = $placeholder AND nr.nid = $this->table_alias.nid) > 0)", array($placeholder => $this->argument));
  15. }
  16. }