You are here

public function Relation::setOwner in Relation 8.2

Same name and namespace in other branches
  1. 8 src/Entity/Relation.php \Drupal\relation\Entity\Relation::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/Relation.php, line 152

Class

Relation
Defines relation entity.

Namespace

Drupal\relation\Entity

Code

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