You are here

public function DomainSource::query in Domain Access 8

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

domain_source/src/Plugin/views/filter/DomainSource.php, line 32

Class

DomainSource
Filter by published status.

Namespace

Drupal\domain_source\Plugin\views\filter

Code

public function query() {
  $active_index = array_search('_active', (array) $this->value);
  if ($active_index !== FALSE) {
    $active_id = \Drupal::service('domain.negotiator')
      ->getActiveId();
    $this->value[$active_index] = $active_id;
  }
  parent::query();
}