You are here

protected function ContentTranslationHandler::hasAuthor in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/content_translation/src/ContentTranslationHandler.php \Drupal\content_translation\ContentTranslationHandler::hasAuthor()
  2. 9 core/modules/content_translation/src/ContentTranslationHandler.php \Drupal\content_translation\ContentTranslationHandler::hasAuthor()

Checks whether the entity type supports author natively.

Return value

bool TRUE if metadata is natively supported, FALSE otherwise.

File

core/modules/content_translation/src/ContentTranslationHandler.php, line 218

Class

ContentTranslationHandler
Base class for content translation handlers.

Namespace

Drupal\content_translation

Code

protected function hasAuthor() {

  // Check for field named uid, but only in case the entity implements the
  // EntityOwnerInterface. This helps to exclude cases, where the uid is
  // defined as field name, but is not meant to be an owner field; for
  // instance, the User entity.
  return $this->entityType
    ->entityClassImplements(EntityOwnerInterface::class) && $this
    ->checkFieldStorageDefinitionTranslatability('uid');
}