You are here

public function Contact::getOwner in Examples for Developers 8

Same name and namespace in other branches
  1. 3.x modules/content_entity_example/src/Entity/Contact.php \Drupal\content_entity_example\Entity\Contact::getOwner()

Returns the entity owner's user entity.

Return value

\Drupal\user\UserInterface The owner user entity.

Overrides EntityOwnerInterface::getOwner

File

content_entity_example/src/Entity/Contact.php, line 158

Class

Contact
Defines the ContentEntityExample entity.

Namespace

Drupal\content_entity_example\Entity

Code

public function getOwner() {
  return $this
    ->get('user_id')->entity;
}