You are here

public function EckEntity::getOwnerId in Entity Construction Kit (ECK) 8

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

File

src/Entity/EckEntity.php, line 60

Class

EckEntity
Defines the ECK entity.

Namespace

Drupal\eck\Entity

Code

public function getOwnerId() {
  if ($owner = $this
    ->getOwner()) {
    return $owner
      ->id();
  }
  return NULL;
}