You are here

public function SimpleMegaMenu::setOwner in Simple Mega Menu 8

Same name and namespace in other branches
  1. 2.0.x src/Entity/SimpleMegaMenu.php \Drupal\simple_megamenu\Entity\SimpleMegaMenu::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/SimpleMegaMenu.php, line 177

Class

SimpleMegaMenu
Defines the Simple mega menu entity.

Namespace

Drupal\simple_megamenu\Entity

Code

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