You are here

public function Query::setLanguages in Search API 8

Sets the languages that should be searched by this query.

Parameters

string[]|null $languages: The language codes to search for, or NULL to not restrict the query to specific languages.

Return value

$this

Overrides QueryInterface::setLanguages

File

src/Query/Query.php, line 409

Class

Query
Provides a standard implementation for a Search API query.

Namespace

Drupal\search_api\Query

Code

public function setLanguages(array $languages = NULL) {
  $this->languages = $languages !== NULL ? array_values($languages) : NULL;
  return $this;
}