You are here

public function ILT::setOwner in Opigno Instructor-led Trainings 8

Same name and namespace in other branches
  1. 3.x src/Entity/ILT.php \Drupal\opigno_ilt\Entity\ILT::setOwner()

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/ILT.php, line 76

Class

ILT
Defines the ILT entity.

Namespace

Drupal\opigno_ilt\Entity

Code

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