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