You are here

public function PathFileEntity::setOwner in Path File 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/PathFileEntity.php, line 124

Class

PathFileEntity
Defines the Path file entity entity.

Namespace

Drupal\path_file\Entity

Code

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