function UserUid::query
Same name in this branch
- 11.x core/modules/tracker/src/Plugin/views/filter/UserUid.php \Drupal\tracker\Plugin\views\filter\UserUid::query()
- 11.x core/modules/tracker/src/Plugin/views/argument/UserUid.php \Drupal\tracker\Plugin\views\argument\UserUid::query()
- 11.x core/modules/comment/src/Plugin/views/argument/UserUid.php \Drupal\comment\Plugin\views\argument\UserUid::query()
Same name in other branches
- 9 core/modules/tracker/src/Plugin/views/filter/UserUid.php \Drupal\tracker\Plugin\views\filter\UserUid::query()
- 9 core/modules/tracker/src/Plugin/views/argument/UserUid.php \Drupal\tracker\Plugin\views\argument\UserUid::query()
- 9 core/modules/comment/src/Plugin/views/filter/UserUid.php \Drupal\comment\Plugin\views\filter\UserUid::query()
- 9 core/modules/comment/src/Plugin/views/argument/UserUid.php \Drupal\comment\Plugin\views\argument\UserUid::query()
- 8.9.x core/modules/tracker/src/Plugin/views/filter/UserUid.php \Drupal\tracker\Plugin\views\filter\UserUid::query()
- 8.9.x core/modules/tracker/src/Plugin/views/argument/UserUid.php \Drupal\tracker\Plugin\views\argument\UserUid::query()
- 8.9.x core/modules/comment/src/Plugin/views/filter/UserUid.php \Drupal\comment\Plugin\views\filter\UserUid::query()
- 8.9.x core/modules/comment/src/Plugin/views/argument/UserUid.php \Drupal\comment\Plugin\views\argument\UserUid::query()
- 10 core/modules/tracker/src/Plugin/views/filter/UserUid.php \Drupal\tracker\Plugin\views\filter\UserUid::query()
- 10 core/modules/tracker/src/Plugin/views/argument/UserUid.php \Drupal\tracker\Plugin\views\argument\UserUid::query()
- 10 core/modules/comment/src/Plugin/views/filter/UserUid.php \Drupal\comment\Plugin\views\filter\UserUid::query()
- 10 core/modules/comment/src/Plugin/views/argument/UserUid.php \Drupal\comment\Plugin\views\argument\UserUid::query()
Overrides FilterPluginBase::query
File
-
core/
modules/ comment/ src/ Plugin/ views/ filter/ UserUid.php, line 17
Class
- UserUid
- Filter handler, accepts user ID to check for nodes user posted/commented on.
Namespace
Drupal\comment\Plugin\views\filterCode
public function query() {
$this->ensureMyTable();
$subselect = Database::getConnection()->select('comment_field_data', 'c');
$subselect->addField('c', 'cid');
$subselect->condition('c.uid', $this->value, $this->operator);
$entity_id = $this->definition['entity_id'];
$entity_type = $this->definition['entity_type'];
$subselect->where("[c].[entity_id] = [{$this->tableAlias}].[{$entity_id}]");
$subselect->condition('c.entity_type', $entity_type);
$condition = $this->view->query
->getConnection()
->condition('OR')
->condition("{$this->tableAlias}.uid", $this->value, $this->operator)
->exists($subselect);
$this->query
->addWhere($this->options['group'], $condition);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.