Comment::setOwner

public Comment::setOwner(UserInterface $account)

Sets the entity owner's user entity.

Parameters

\Drupal\user\UserInterface $account: The owner user entity.

Return value

$this

Overrides EntityOwnerInterface::setOwner

File

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

Class

Comment
Defines the comment entity class.

Namespace

Drupal\comment\Entity

Code

public function setOwner(UserInterface $account) {
  $this->set('uid', $account->id());
  return $this;
}
doc_Drupal
2016-10-29 08:50:24
Comments
Leave a Comment

Please login to continue.