You are here

public function UidRevision::query in Views (for Drupal 7) 8.3

Same name in this branch
  1. 8.3 lib/Views/node/Plugin/views/filter/UidRevision.php \Views\node\Plugin\views\filter\UidRevision::query()
  2. 8.3 lib/Views/node/Plugin/views/argument/UidRevision.php \Views\node\Plugin\views\argument\UidRevision::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 InOperator::query

File

lib/Views/node/Plugin/views/filter/UidRevision.php, line 25
Definition of Views\node\Plugin\views\filter\UidRevision.

Class

UidRevision
Filter handler to check for revisions a certain user has created.

Namespace

Views\node\Plugin\views\filter

Code

public function query($group_by = FALSE) {
  $this
    ->ensureMyTable();
  $placeholder = $this
    ->placeholder();
  $args = array_values($this->value);
  $this->query
    ->add_where_expression($this->options['group'], "{$this->tableAlias}.uid IN({$placeholder}) OR\n      ((SELECT COUNT(*) FROM {node_revision} nr WHERE nr.uid IN({$placeholder}) AND nr.nid = {$this->tableAlias}.nid) > 0)", array(
    $placeholder => $args,
  ), $args);
}