You are here

public function Comment::setOwner in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/modules/comment/src/Entity/Comment.php \Drupal\comment\Entity\Comment::setOwner()

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 572
Contains \Drupal\comment\Entity\Comment.

Class

Comment
Defines the comment entity class.

Namespace

Drupal\comment\Entity

Code

public function setOwner(UserInterface $account) {
  $this
    ->set('uid', $account
    ->id());
  return $this;
}