You are here

public function ContentEntityBase::isDefaultTranslationAffectedOnly in Drupal 9

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Entity/ContentEntityBase.php \Drupal\Core\Entity\ContentEntityBase::isDefaultTranslationAffectedOnly()

Checks if untranslatable fields should affect only the default translation.

Return value

bool TRUE if untranslatable fields should affect only the default translation, FALSE otherwise.

Overrides TranslatableRevisionableInterface::isDefaultTranslationAffectedOnly

1 call to ContentEntityBase::isDefaultTranslationAffectedOnly()
ContentEntityBase::hasTranslationChanges in core/lib/Drupal/Core/Entity/ContentEntityBase.php
Determines if the current translation of the entity has unsaved changes.

File

core/lib/Drupal/Core/Entity/ContentEntityBase.php, line 1454

Class

ContentEntityBase
Implements Entity Field API specific enhancements to the Entity class.

Namespace

Drupal\Core\Entity

Code

public function isDefaultTranslationAffectedOnly() {
  $bundle_name = $this
    ->bundle();
  $bundle_info = \Drupal::service('entity_type.bundle.info')
    ->getBundleInfo($this
    ->getEntityTypeId());
  return !empty($bundle_info[$bundle_name]['untranslatable_fields.default_translation_affected']);
}