You are here

public function FlagViewsFilter::query in Flag 8.4

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

File

src/Plugin/views/filter/FlagViewsFilter.php, line 51

Class

FlagViewsFilter
Filters content by its flagging status in a view.

Namespace

Drupal\flag\Plugin\views\filter

Code

public function query() {
  $this
    ->ensureMyTable();
  $operator = $this->value ? 'IS NOT' : 'IS';
  $operator .= ' NULL';
  $this->query
    ->addWhere($this->options['group'], "{$this->tableAlias}.uid", NULL, $operator);
}