You are here

public function ConsentAgreement::setOwner in General Data Protection Regulation 3.0.x

Same name and namespace in other branches
  1. 8.2 modules/gdpr_consent/src/Entity/ConsentAgreement.php \Drupal\gdpr_consent\Entity\ConsentAgreement::setOwner()
  2. 8 modules/gdpr_consent/src/Entity/ConsentAgreement.php \Drupal\gdpr_consent\Entity\ConsentAgreement::setOwner()

Sets the entity owner's user entity.

Parameters

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

Return value

$this

Overrides EntityOwnerInterface::setOwner

File

modules/gdpr_consent/src/Entity/ConsentAgreement.php, line 189

Class

ConsentAgreement
Defines the ConsentAgreement entity.

Namespace

Drupal\gdpr_consent\Entity

Code

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