You are here

public function UidRevision::query in Support Ticketing System 8

Same name in this branch
  1. 8 modules/support_ticket/src/Plugin/views/filter/UidRevision.php \Drupal\support_ticket\Plugin\views\filter\UidRevision::query()
  2. 8 modules/support_ticket/src/Plugin/views/argument/UidRevision.php \Drupal\support_ticket\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

modules/support_ticket/src/Plugin/views/filter/UidRevision.php, line 21
Contains \Drupal\support_ticket\Plugin\views\filter\UidRevision.

Class

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

Namespace

Drupal\support_ticket\Plugin\views\filter

Code

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