1 views_handler_filter_comment_user_uid.inc views_handler_filter_comment_user_uid::query()

Add this filter to the query.

Due to the nature of fapi, the value and the operator have an unintended level of indirection. You will find them in $this->operator and $this->value respectively.

Overrides views_handler_filter_in_operator::query

File

core/modules/comment/views/views_handler_filter_comment_user_uid.inc, line 14
Definition of views_handler_filter_comment_user_uid.

Class

views_handler_filter_comment_user_uid
Filter handler to accept a user id to check for nodes that user posted or commented on.

Code

function query() {
  $this->ensure_my_table();

  $subselect = db_select('comment', 'c');
  $subselect->addField('c', 'cid');
  $subselect->condition('c.uid', $this->value, $this->operator);
  $subselect->where("c.nid = $this->table_alias.nid");

  $condition = db_or()
    ->condition("$this->table_alias.uid", $this->value, $this->operator)
    ->exists($subselect);

  $this->query->add_where($this->options['group'], $condition);
}