public function ContentEntityBase::getTranslationStatus in Drupal 10
Same name and namespace in other branches
- 8 core/lib/Drupal/Core/Entity/ContentEntityBase.php \Drupal\Core\Entity\ContentEntityBase::getTranslationStatus()
- 9 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 1001
Class
- ContentEntityBase
- Implements Entity Field API specific enhancements to the Entity class.
Namespace
Drupal\Core\EntityCode
public function getTranslationStatus($langcode) {
if ($langcode == $this->defaultLangcode) {
$langcode = LanguageInterface::LANGCODE_DEFAULT;
}
return isset($this->translations[$langcode]) ? $this->translations[$langcode]['status'] : NULL;
}