You are here

public function Flagging::setOwner in Flag 8.4

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/Flagging.php, line 214

Class

Flagging
Provides the flagging content entity.

Namespace

Drupal\flag\Entity

Code

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