ContentTranslationManager::setEnabled

public ContentTranslationManager::setEnabled($entity_type_id, $bundle, $value)

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 81

Class

ContentTranslationManager
Provides common functionality for content translation.

Namespace

Drupal\content_translation

Code

public function setEnabled($entity_type_id, $bundle, $value) {
  $config = $this->loadContentLanguageSettings($entity_type_id, $bundle);
  $config->setThirdPartySetting('content_translation', 'enabled', $value)->save();
  $entity_type = $this->entityManager->getDefinition($entity_type_id);
  $this->updatesManager->updateDefinitions(array($entity_type_id => $entity_type));
}
doc_Drupal
2016-10-29 08:58:21
Comments
Leave a Comment

Please login to continue.