You are here

public function DataPolicy::setOwner in Data Policy 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/DataPolicy.php, line 155

Class

DataPolicy
Defines the Data policy entity.

Namespace

Drupal\data_policy\Entity

Code

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