You are here

public function Comment::getOwnerId in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/comment/src/Entity/Comment.php \Drupal\comment\Entity\Comment::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

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

File

core/modules/comment/src/Entity/Comment.php, line 557
Contains \Drupal\comment\Entity\Comment.

Class

Comment
Defines the comment entity class.

Namespace

Drupal\comment\Entity

Code

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