You are here

protected function ContentEntity::getTranslationOptions in Search API 8

Retrieves the available languages of this entity type as an options list.

Return value

array An associative array of language labels, keyed by the language name.

1 call to ContentEntity::getTranslationOptions()
ContentEntity::buildConfigurationForm in src/Plugin/search_api/datasource/ContentEntity.php
Form constructor.

File

src/Plugin/search_api/datasource/ContentEntity.php, line 633

Class

ContentEntity
Represents a datasource which exposes the content entities.

Namespace

Drupal\search_api\Plugin\search_api\datasource

Code

protected function getTranslationOptions() {
  $options = [];
  foreach ($this
    ->getLanguageManager()
    ->getLanguages() as $language) {
    $options[$language
      ->getId()] = $language
      ->getName();
  }
  return $options;
}