You are here

public function Project::setOwner in Drupal PM (Project Management) 4.x

Sets the entity owner's user entity.

Parameters

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

Return value

$this

Overrides EntityOwnerInterface::setOwner

File

modules/pm_project/src/Entity/Project.php, line 171

Class

Project
Defines the Project entity.

Namespace

Drupal\pm_project\Entity

Code

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