function ContentEntityStorageBase::isAnyRevisionTranslated

Same name in other branches
  1. 8.9.x core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php \Drupal\Core\Entity\ContentEntityStorageBase::isAnyRevisionTranslated()
  2. 10 core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php \Drupal\Core\Entity\ContentEntityStorageBase::isAnyRevisionTranslated()
  3. 11.x 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 299

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);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.