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()

Set up the query for this argument.

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

Overrides NumericArgument::query

File

modules/support_ticket/src/Plugin/views/argument/UidRevision.php, line 20
Contains \Drupal\support_ticket\Plugin\views\argument\UidRevision.

Class

UidRevision
Filter handler to accept a user id to check for support tickets that user posted or created a revision on.

Namespace

Drupal\support_ticket\Plugin\views\argument

Code

public function query($group_by = FALSE) {
  $this
    ->ensureMyTable();
  $placeholder = $this
    ->placeholder();
  $this->query
    ->addWhereExpression(0, "{$this->tableAlias}.revision_uid = {$placeholder} OR ((SELECT COUNT(DISTINCT vid) FROM {support_ticket_revision} nr WHERE nfr.revision_uid = {$placeholder} AND nr.stid = {$this->tableAlias}.stid) > 0)", array(
    $placeholder => $this->argument,
  ));
}