You are here

protected function Database::addLanguageConditions in Search API 8

Adds item language conditions to the condition group, if applicable.

Parameters

\Drupal\search_api\Query\ConditionGroupInterface $condition_group: The condition group on which to set conditions.

\Drupal\search_api\Query\QueryInterface $query: The query to inspect for language settings.

See also

\Drupal\search_api\Query\QueryInterface::getLanguages()

1 call to Database::addLanguageConditions()
Database::createDbQuery in modules/search_api_db/src/Plugin/search_api/backend/Database.php
Creates a database query for a search.

File

modules/search_api_db/src/Plugin/search_api/backend/Database.php, line 2184

Class

Database
Indexes and searches items using the database.

Namespace

Drupal\search_api_db\Plugin\search_api\backend

Code

protected function addLanguageConditions(ConditionGroupInterface $condition_group, QueryInterface $query) {
  $languages = $query
    ->getLanguages();
  if ($languages !== NULL) {
    $condition_group
      ->addCondition('search_api_language', $languages, 'IN');
  }
}