public function UserUid::query

Same name in this branch

Set up the query for this argument.

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

Overrides ArgumentPluginBase::query

1 method overrides UserUid::query()
UserUid::query in drupal/core/modules/tracker/lib/Drupal/tracker/Plugin/views/argument/UserUid.php
Set up the query for this argument.

File

drupal/core/modules/comment/lib/Drupal/comment/Plugin/views/argument/UserUid.php, line 54
Definition of Drupal\comment\Plugin\views\argument\UserUid.

Class

UserUid
Argument handler to accept a user id to check for nodes that user posted or commented on.

Namespace

Drupal\comment\Plugin\views\argument

Code

public function query($group_by = FALSE) {
  $this
    ->ensureMyTable();
  $subselect = db_select('comment', 'c');
  $subselect
    ->addField('c', 'cid');
  $subselect
    ->condition('c.uid', $this->argument);
  $subselect
    ->where("c.nid = {$this->tableAlias}.nid");
  $condition = db_or()
    ->condition("{$this->tableAlias}.uid", $this->argument, '=')
    ->exists($subselect);
  $this->query
    ->addWhere(0, $condition);
}