Bladeren bron

added current language condition to searchapi query

Bachir Soussi Chiadmi 6 jaren geleden
bovenliggende
commit
d62d02201b
1 gewijzigde bestanden met toevoegingen van 4 en 0 verwijderingen
  1. 4 0
      sites/all/modules/figli/edlp_search/src/Controller/EdlpSearchController.php

+ 4 - 0
sites/all/modules/figli/edlp_search/src/Controller/EdlpSearchController.php

@@ -336,6 +336,10 @@ class EdlpSearchController extends ControllerBase {
 
     // TODO: locuteurs
 
+    $language = \Drupal::languageManager()->getCurrentLanguage()->getId();
+    // $language =  \Drupal::languageManager()->getCurrentLanguage()->getName();
+    $query->addCondition('search_api_language', $language);
+
     $result = $query->execute();
     $items = $result->getResultItems();
     // dpm($items);