You are here

public function ContentLockFilter::query in Content locking (anti-concurrent editing) 8

Same name and namespace in other branches
  1. 8.2 src/Plugin/views/filter/ContentLockFilter.php \Drupal\content_lock\Plugin\views\filter\ContentLockFilter::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 BooleanOperator::query

File

src/Plugin/views/filter/ContentLockFilter.php, line 19

Class

ContentLockFilter
Filter handler for content lock.

Namespace

Drupal\content_lock\Plugin\views\filter

Code

public function query() {
  $this
    ->ensureMyTable();
  if (empty($this->value)) {
    $this->query
      ->addWhere($this->options['group'], $this->tableAlias . ".timestamp", 0, static::EQUAL);
  }
  else {
    $this->query
      ->addWhere($this->options['group'], $this->tableAlias . ".timestamp", 0, static::NOT_EQUAL);
  }
}