You are here

public function LanguageFilter::query in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/views/src/Plugin/views/filter/LanguageFilter.php \Drupal\views\Plugin\views\filter\LanguageFilter::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 InOperator::query

File

core/modules/views/src/Plugin/views/filter/LanguageFilter.php, line 73

Class

LanguageFilter
Provides filtering by language.

Namespace

Drupal\views\Plugin\views\filter

Code

public function query() {

  // Don't filter by language in case the site is not multilingual, because
  // there is no point in doing so.
  if (!$this->languageManager
    ->isMultilingual()) {
    return;
  }
  parent::query();
}