You are here

public function EntityOwnerTrait::getOwner in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/user/src/EntityOwnerTrait.php \Drupal\user\EntityOwnerTrait::getOwner()
  2. 9 core/modules/user/src/EntityOwnerTrait.php \Drupal\user\EntityOwnerTrait::getOwner()
1 call to EntityOwnerTrait::getOwner()
Media::loadThumbnail in core/modules/media/src/Entity/Media.php
Loads the file entity for the thumbnail.

File

core/modules/user/src/EntityOwnerTrait.php, line 65

Class

EntityOwnerTrait
Provides a trait for entities that have an owner.

Namespace

Drupal\user

Code

public function getOwner() {
  $key = $this
    ->getEntityType()
    ->getKey('owner');
  return $this
    ->get($key)->entity;
}