You are here

public function Profile::setOwner in Profile 2 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/Profile.php, line 184
Contains \Drupal\profile\Entity\Profile.

Class

Profile
Defines the profile entity class.

Namespace

Drupal\profile\Entity

Code

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