You are here

public function ContentTranslationMetadataWrapper::getAuthor in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/content_translation/src/ContentTranslationMetadataWrapper.php \Drupal\content_translation\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 78
Contains \Drupal\content_translation\ContentTranslationMetadataWrapper.

Class

ContentTranslationMetadataWrapper
Base class for content translation metadata wrappers.

Namespace

Drupal\content_translation

Code

public function getAuthor() {
  return $this->translation
    ->hasField('content_translation_uid') ? $this->translation
    ->get('content_translation_uid')->entity : $this->translation
    ->getOwner();
}