Comment::getOwnerId

public 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

File

core/modules/comment/src/Entity/Comment.php, line 536

Class

Comment
Defines the comment entity class.

Namespace

Drupal\comment\Entity

Code

public function getOwnerId() {
  return $this->get('uid')->target_id;
}
doc_Drupal
2016-10-29 08:50:21
Comments
Leave a Comment

Please login to continue.