Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. EntityOwnerTrait.php

function EntityOwnerTrait::getOwner

2 calls to EntityOwnerTrait::getOwner()
Media::loadThumbnail in core/modules/media/src/Entity/Media.php
Loads the file entity for the thumbnail.
Media::preSave in core/modules/media/src/Entity/Media.php
Acts on an entity before the presave hook is invoked.
1 method overrides EntityOwnerTrait::getOwner()
Comment::getOwner in core/modules/comment/src/Entity/Comment.php
Returns the entity owner's user entity.

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

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal