You are here

protected function ContentEntityStorageBase::isAnyRevisionTranslated in Drupal 10

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php \Drupal\Core\Entity\ContentEntityStorageBase::isAnyRevisionTranslated()
  2. 9 core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php \Drupal\Core\Entity\ContentEntityStorageBase::isAnyRevisionTranslated()

Checks whether any entity revision is translated.

Parameters

\Drupal\Core\Entity\TranslatableInterface $entity: The entity object to be checked.

Return value

bool TRUE if the entity has at least one translation in any revision, FALSE otherwise.

See also

\Drupal\Core\TypedData\TranslatableInterface::getTranslationLanguages()

\Drupal\Core\Entity\ContentEntityStorageBase::isAnyStoredRevisionTranslated()

1 call to ContentEntityStorageBase::isAnyRevisionTranslated()
ContentEntityStorageBase::createRevision in core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php
Creates a new revision starting off from the specified entity object.

File

core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php, line 302

Class

ContentEntityStorageBase
Base class for content entity storage handlers.

Namespace

Drupal\Core\Entity

Code

protected function isAnyRevisionTranslated(TranslatableInterface $entity) {
  return $entity
    ->getTranslationLanguages(FALSE) || $this
    ->isAnyStoredRevisionTranslated($entity);
}