You are here

public function SimpleMegaMenu::getOwnerId in Simple Mega Menu 2.0.x

Same name and namespace in other branches
  1. 8 src/Entity/SimpleMegaMenu.php \Drupal\simple_megamenu\Entity\SimpleMegaMenu::getOwnerId()

Returns the entity owner's user ID.

Return value

int|null The owner user ID, or NULL in case the user ID field has not been set on the entity.

Overrides EntityOwnerInterface::getOwnerId

1 call to SimpleMegaMenu::getOwnerId()
SimpleMegaMenu::preSave in src/Entity/SimpleMegaMenu.php
Acts on an entity before the presave hook is invoked.

File

src/Entity/SimpleMegaMenu.php, line 162

Class

SimpleMegaMenu
Defines the Simple mega menu entity.

Namespace

Drupal\simple_megamenu\Entity

Code

public function getOwnerId() {
  return $this
    ->get('user_id')->target_id;
}