You are here

public function Event::getOwnerId in Event 8

Returns the entity owner's user ID.

Return value

int|null The owner user ID, or NULL in case the user ID field has not been set on the entity.

Overrides EntityOwnerInterface::getOwnerId

1 call to Event::getOwnerId()
Event::preSave in src/Entity/Event.php
Acts on an entity before the presave hook is invoked.

File

src/Entity/Event.php, line 188

Class

Event
Defines the Event entity.

Namespace

Drupal\event\Entity

Code

public function getOwnerId() {
  return $this
    ->get('user_id')->target_id;
}