You are here

public function Developer::getOwnerId in Apigee Edge 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

1 call to Developer::getOwnerId()
Developer::getOwner in src/Entity/Developer.php
Returns the entity owner's user entity.

File

src/Entity/Developer.php, line 426

Class

Developer
Defines the Developer entity class.

Namespace

Drupal\apigee_edge\Entity

Code

public function getOwnerId() {
  if ($this->drupalUserId === NULL) {
    if ($this
      ->getEmail()) {

      /** @var \Drupal\user\UserInterface $account */
      $account = user_load_by_mail($this
        ->getEmail());
      if ($account) {
        $this->drupalUserId = $account
          ->id();
      }
    }

    // Username is not unique on Apigee Edge so we do not use that here.
  }
  return $this->drupalUserId;
}