You are here

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

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 FilterPluginBase::query

File

lib/Views/translation/Plugin/views/filter/NodeTnid.php, line 52
Definition of Views\translation\Plugin\views\filter\NodeTnid.

Class

NodeTnid
Filter by whether the node is the original translation.

Namespace

Views\translation\Plugin\views\filter

Code

public function query() {
  $table = $this
    ->ensureMyTable();

  // Select for source translations (tnid = nid). Conditionally, also accept either untranslated nodes (tnid = 0).
  $this->query
    ->add_where_expression($this->options['group'], "{$table}.tnid = {$table}.nid" . ($this->operator ? " OR {$table}.tnid = 0" : ''));
}