public function LingotekConfigurationService::setProfile in Lingotek Translation 8
Same name and namespace in other branches
- 8.2 src/LingotekConfigurationService.php \Drupal\lingotek\LingotekConfigurationService::setProfile()
- 4.0.x src/LingotekConfigurationService.php \Drupal\lingotek\LingotekConfigurationService::setProfile()
- 3.0.x src/LingotekConfigurationService.php \Drupal\lingotek\LingotekConfigurationService::setProfile()
- 3.1.x src/LingotekConfigurationService.php \Drupal\lingotek\LingotekConfigurationService::setProfile()
- 3.2.x src/LingotekConfigurationService.php \Drupal\lingotek\LingotekConfigurationService::setProfile()
- 3.3.x src/LingotekConfigurationService.php \Drupal\lingotek\LingotekConfigurationService::setProfile()
- 3.4.x src/LingotekConfigurationService.php \Drupal\lingotek\LingotekConfigurationService::setProfile()
- 3.5.x src/LingotekConfigurationService.php \Drupal\lingotek\LingotekConfigurationService::setProfile()
- 3.6.x src/LingotekConfigurationService.php \Drupal\lingotek\LingotekConfigurationService::setProfile()
- 3.7.x src/LingotekConfigurationService.php \Drupal\lingotek\LingotekConfigurationService::setProfile()
- 3.8.x src/LingotekConfigurationService.php \Drupal\lingotek\LingotekConfigurationService::setProfile()
Sets the default Lingotek profile for the given entity.
Parameters
ContentEntityInterface $entity: The entity.
string $profile_id: The profile id.
bool $save: Indicates if we should save the entity after setting the value.
Overrides LingotekConfigurationServiceInterface::setProfile
File
- src/
LingotekConfigurationService.php, line 156 - Contains \Drupal\lingotek\LingotekConfigurationService.
Class
- LingotekConfigurationService
- Service for managing lingotek configuration.
Namespace
Drupal\lingotekCode
public function setProfile(ContentEntityInterface &$entity, $profile_id, $save = TRUE) {
$entity->lingotek_profile->target_id = $profile_id;
if ($save) {
$entity
->save();
}
}