You are here

public function Relation::setOwner in Relation 8

Same name and namespace in other branches
  1. 8.2 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 151
Contains \Drupal\relation\Entity\Relation.

Class

Relation
Defines relation entity.

Namespace

Drupal\relation\Entity

Code

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