You are here

public function DeveloperApp::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

2 calls to DeveloperApp::getOwnerId()
DeveloperApp::getOwner in src/Entity/DeveloperApp.php
Returns the entity owner's user entity.
DeveloperApp::urlRouteParameters in src/Entity/DeveloperApp.php
Gets an array of placeholders for this entity.

File

src/Entity/DeveloperApp.php, line 165

Class

DeveloperApp
Defines the Developer app entity class.

Namespace

Drupal\apigee_edge\Entity

Code

public function getOwnerId() {
  if ($this->drupalUserId === NULL) {
    if ($this
      ->getDeveloperId()) {
      $developer = Developer::load($this
        ->getDeveloperId());
      if ($developer) {

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