You are here

public function ContentEntityBase::getTranslationStatus in Drupal 9

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

Returns the translation status.

Parameters

string $langcode: The language code identifying the translation.

Return value

int|null One of the TRANSLATION_* constants or NULL if the given translation does not exist.

Overrides TranslationStatusInterface::getTranslationStatus

File

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

Class

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

Namespace

Drupal\Core\Entity

Code

public function getTranslationStatus($langcode) {
  if ($langcode == $this->defaultLangcode) {
    $langcode = LanguageInterface::LANGCODE_DEFAULT;
  }
  return isset($this->translations[$langcode]) ? $this->translations[$langcode]['status'] : NULL;
}