You are here

public function MediaGallery::setOwner in Media Gallery 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/MediaGallery.php, line 141

Class

MediaGallery
Defines the media gallery entity class.

Namespace

Drupal\media_gallery\Entity

Code

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