You are here

public function Task::setOwner in General Data Protection Regulation 8

Same name and namespace in other branches
  1. 8.2 modules/gdpr_tasks/src/Entity/Task.php \Drupal\gdpr_tasks\Entity\Task::setOwner()
  2. 3.0.x modules/gdpr_tasks/src/Entity/Task.php \Drupal\gdpr_tasks\Entity\Task::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_tasks/src/Entity/Task.php, line 109

Class

Task
Defines the Task entity.

Namespace

Drupal\gdpr_tasks\Entity

Code

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