protected function ContentEntityFallback::getLanguages in Entity Language Fallback 8
Retrieves the enabled languages.
Return value
\Drupal\Core\Language\LanguageInterface[] All languages that are enabled for this datasource, keyed by language code.
Overrides ContentEntity::getLanguages
1 call to ContentEntityFallback::getLanguages()
- ContentEntityFallback::loadMultiple in src/
Plugin/ search_api/ datasource/ ContentEntityFallback.php - Loads multiple items.
File
- src/
Plugin/ search_api/ datasource/ ContentEntityFallback.php, line 140
Class
- ContentEntityFallback
- Represents a datasource which exposes the content entities.
Namespace
Drupal\entity_language_fallback\Plugin\search_api\datasourceCode
protected function getLanguages() {
$parent_languages = parent::getLanguages();
if (!isset($this->languages)) {
$this->languages = ConfigurableLanguage::loadMultiple(array_keys($parent_languages));
foreach ($this->languages as $langcode => $language) {
$this->fallback_chain[$langcode] = $language
->getThirdPartySetting('entity_language_fallback', 'fallback_langcodes', []);
}
}
return $parent_languages;
}