You are here

public function BackgroundImage::setOwner in Background Image 2.0.x

Same name and namespace in other branches
  1. 8 src/Entity/BackgroundImage.php \Drupal\background_image\Entity\BackgroundImage::setOwner()
  2. 2.x src/Entity/BackgroundImage.php \Drupal\background_image\Entity\BackgroundImage::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/BackgroundImage.php, line 715

Class

BackgroundImage
Defines the Background Image entity.

Namespace

Drupal\background_image\Entity

Code

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