You are here

public function LingotekConfigurationService::setDefaultProfileId in Lingotek Translation 8

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

Sets the default Lingotek profile for the given entity type.

Parameters

string $entity_type_id: The type of the entity.

string $bundle: The bundle of the entity.

string $profile_id: The profile id.

Overrides LingotekConfigurationServiceInterface::setDefaultProfileId

File

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

Class

LingotekConfigurationService
Service for managing lingotek configuration.

Namespace

Drupal\lingotek

Code

public function setDefaultProfileId($entity_type_id, $bundle, $profile_id) {
  $config = \Drupal::configFactory()
    ->getEditable('lingotek.settings');
  $config
    ->set('translate.entity.' . $entity_type_id . '.' . $bundle . '.profile', $profile_id);
  $config
    ->save();
}