You are here

public function ContentEntityBase::isDefaultTranslation in Drupal 9

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

Checks whether the translation is the default one.

Return value

bool TRUE if the translation is the default one, FALSE otherwise.

Overrides TranslatableInterface::isDefaultTranslation

2 calls to ContentEntityBase::isDefaultTranslation()
ContentEntityBase::hasTranslationChanges in core/lib/Drupal/Core/Entity/ContentEntityBase.php
Determines if the current translation of the entity has unsaved changes.
ContentEntityBase::onChange in core/lib/Drupal/Core/Entity/ContentEntityBase.php
Reacts to changes to a field.

File

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

Class

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

Namespace

Drupal\Core\Entity

Code

public function isDefaultTranslation() {
  return $this->activeLangcode === LanguageInterface::LANGCODE_DEFAULT;
}