ContentTranslationMetadataWrapper::getAuthor

Returns the translation author.

Return value

\Drupal\user\UserInterface The user entity for the translation author.

Overrides ContentTranslationMetadataWrapperInterface::getAuthor

File

core/modules/content_translation/src/ContentTranslationMetadataWrapper.php, line 73

Class

ContentTranslationMetadataWrapper
Base class for content translation metadata wrappers.

Namespace

Drupal\content_translation

Code

1
2
3
public function getAuthor() {
  return $this->translation->hasField('content_translation_uid') ? $this->translation->get('content_translation_uid')->entity : $this->translation->getOwner();
}
doc_Drupal
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.