You are here

public function AccessToken::setOwner in Access unpublished 8

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/AccessToken.php, line 113

Class

AccessToken
Defines the Access token entity.

Namespace

Drupal\access_unpublished\Entity

Code

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