You are here

public function Vote::setOwner in Voting API 8.3

Sets the entity owner's user entity.

Parameters

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

Return value

$this

Overrides EntityOwnerInterface::setOwner

File

src/Entity/Vote.php, line 117

Class

Vote
Defines the Vote entity.

Namespace

Drupal\votingapi\Entity

Code

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