views_handler_filter_comment_user_uid.inc in Views (for Drupal 7) 7.3
Same filename and directory in other branches
Definition of views_handler_filter_comment_user_uid.
File
modules/comment/views_handler_filter_comment_user_uid.incView source
<?php
/**
* @file
* Definition of views_handler_filter_comment_user_uid.
*/
/**
* Filter handler to accept a user id to check for nodes that user posted or
* commented on.
*
* @ingroup views_filter_handlers
*/
class views_handler_filter_comment_user_uid extends views_handler_filter_user_name {
/**
* {@inheritdoc}
*/
public 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);
}
}
Classes
Name![]() |
Description |
---|---|
views_handler_filter_comment_user_uid | Filter handler to accept a user id to check for nodes that user posted or commented on. |