You are here

public function PrivateMessage::getOwnerId in Private Message 8

Same name and namespace in other branches
  1. 8.2 src/Entity/PrivateMessage.php \Drupal\private_message\Entity\PrivateMessage::getOwnerId()

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

File

src/Entity/PrivateMessage.php, line 71

Class

PrivateMessage
Thee Private Message entity definition.

Namespace

Drupal\private_message\Entity

Code

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