public function LingotekConfigurationService::getDefaultProfileId in Lingotek Translation 8.2
Same name and namespace in other branches
- 8 src/LingotekConfigurationService.php \Drupal\lingotek\LingotekConfigurationService::getDefaultProfileId()
- 4.0.x src/LingotekConfigurationService.php \Drupal\lingotek\LingotekConfigurationService::getDefaultProfileId()
- 3.0.x src/LingotekConfigurationService.php \Drupal\lingotek\LingotekConfigurationService::getDefaultProfileId()
- 3.1.x src/LingotekConfigurationService.php \Drupal\lingotek\LingotekConfigurationService::getDefaultProfileId()
- 3.2.x src/LingotekConfigurationService.php \Drupal\lingotek\LingotekConfigurationService::getDefaultProfileId()
- 3.3.x src/LingotekConfigurationService.php \Drupal\lingotek\LingotekConfigurationService::getDefaultProfileId()
- 3.4.x src/LingotekConfigurationService.php \Drupal\lingotek\LingotekConfigurationService::getDefaultProfileId()
- 3.5.x src/LingotekConfigurationService.php \Drupal\lingotek\LingotekConfigurationService::getDefaultProfileId()
- 3.6.x src/LingotekConfigurationService.php \Drupal\lingotek\LingotekConfigurationService::getDefaultProfileId()
- 3.7.x src/LingotekConfigurationService.php \Drupal\lingotek\LingotekConfigurationService::getDefaultProfileId()
- 3.8.x src/LingotekConfigurationService.php \Drupal\lingotek\LingotekConfigurationService::getDefaultProfileId()
Determines the default Lingotek profile for the given entity type.
@returns string The profile id.
Parameters
string $entity_type_id: The type of the entity.
string $bundle: The bundle of the entity.
Overrides LingotekConfigurationServiceInterface::getDefaultProfileId
1 call to LingotekConfigurationService::getDefaultProfileId()
- LingotekConfigurationService::getEntityProfile in src/
LingotekConfigurationService.php - Determines the default Lingotek profile for the given entity.
File
- src/
LingotekConfigurationService.php, line 100
Class
- LingotekConfigurationService
- Service for managing lingotek configuration.
Namespace
Drupal\lingotekCode
public function getDefaultProfileId($entity_type_id, $bundle, $provide_default = TRUE) {
$config = \Drupal::config('lingotek.settings');
$profile_id = $config
->get('translate.entity.' . $entity_type_id . '.' . $bundle . '.profile');
if ($provide_default && $profile_id === NULL && $this
->isEnabled($entity_type_id, $bundle)) {
if ($entity_type_id === 'paragraph') {
$profile_id = Lingotek::PROFILE_DISABLED;
}
else {
$profile_id = Lingotek::PROFILE_AUTOMATIC;
}
}
return $profile_id;
}