You are here

public function LingotekConfigurationService::getProfileOptions in Lingotek Translation 3.4.x

Same name and namespace in other branches
  1. 8 src/LingotekConfigurationService.php \Drupal\lingotek\LingotekConfigurationService::getProfileOptions()
  2. 8.2 src/LingotekConfigurationService.php \Drupal\lingotek\LingotekConfigurationService::getProfileOptions()
  3. 4.0.x src/LingotekConfigurationService.php \Drupal\lingotek\LingotekConfigurationService::getProfileOptions()
  4. 3.0.x src/LingotekConfigurationService.php \Drupal\lingotek\LingotekConfigurationService::getProfileOptions()
  5. 3.1.x src/LingotekConfigurationService.php \Drupal\lingotek\LingotekConfigurationService::getProfileOptions()
  6. 3.2.x src/LingotekConfigurationService.php \Drupal\lingotek\LingotekConfigurationService::getProfileOptions()
  7. 3.3.x src/LingotekConfigurationService.php \Drupal\lingotek\LingotekConfigurationService::getProfileOptions()
  8. 3.5.x src/LingotekConfigurationService.php \Drupal\lingotek\LingotekConfigurationService::getProfileOptions()
  9. 3.6.x src/LingotekConfigurationService.php \Drupal\lingotek\LingotekConfigurationService::getProfileOptions()
  10. 3.7.x src/LingotekConfigurationService.php \Drupal\lingotek\LingotekConfigurationService::getProfileOptions()
  11. 3.8.x src/LingotekConfigurationService.php \Drupal\lingotek\LingotekConfigurationService::getProfileOptions()

Helper function for getting all the profiles as select options.

Return value

array Profiles as a valid select options property.

Overrides LingotekConfigurationServiceInterface::getProfileOptions

File

src/LingotekConfigurationService.php, line 282

Class

LingotekConfigurationService
Service for managing lingotek configuration.

Namespace

Drupal\lingotek

Code

public function getProfileOptions() {
  $profiles = \Drupal::entityTypeManager()
    ->getListBuilder('lingotek_profile')
    ->load();
  foreach ($profiles as $profile) {

    /** \Drupal\lingotek\LingotekProfileInterface $profile */
    $options[$profile
      ->id()] = $profile
      ->label();
  }
  return $options;
}