You are here

public function LingotekConfigurationService::getConfigEntityDefaultProfileId in Lingotek Translation 8

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

Determines the default Lingotek profile for the given config entity type.

@returns string The profile id.

Parameters

string $plugin_id: The type of the entity.

bool $provide_default: If TRUE, and the entity does not have a profile, will retrieve the default for this entity type and bundle. Defaults to TRUE.

Overrides LingotekConfigurationServiceInterface::getConfigEntityDefaultProfileId

1 call to LingotekConfigurationService::getConfigEntityDefaultProfileId()
LingotekConfigurationService::getConfigEntityProfile in src/LingotekConfigurationService.php
Determines the default Lingotek profile for the given entity.

File

src/LingotekConfigurationService.php, line 83
Contains \Drupal\lingotek\LingotekConfigurationService.

Class

LingotekConfigurationService
Service for managing lingotek configuration.

Namespace

Drupal\lingotek

Code

public function getConfigEntityDefaultProfileId($plugin_id, $provide_default = TRUE) {
  $config = \Drupal::config('lingotek.settings');
  $profile_id = $config
    ->get('translate.config.' . $plugin_id . '.profile');
  if ($provide_default && $profile_id === NULL) {
    $profile_id = Lingotek::PROFILE_AUTOMATIC;
  }
  return $profile_id;
}