public function ContentTranslationManager::setEnabled in Drupal 9
Same name and namespace in other branches
- 8 core/modules/content_translation/src/ContentTranslationManager.php \Drupal\content_translation\ContentTranslationManager::setEnabled()
Sets the value for translatability of the given entity type bundle.
Parameters
string $entity_type_id: The entity type.
string $bundle: The bundle of the entity.
bool $value: The boolean value we need to save.
Overrides ContentTranslationManagerInterface::setEnabled
File
- core/
modules/ content_translation/ src/ ContentTranslationManager.php, line 83
Class
- ContentTranslationManager
- Provides common functionality for content translation.
Namespace
Drupal\content_translationCode
public function setEnabled($entity_type_id, $bundle, $value) {
$config = $this
->loadContentLanguageSettings($entity_type_id, $bundle);
$config
->setThirdPartySetting('content_translation', 'enabled', $value)
->save();
}