You are here

public function AppCache::getAppOwner in Apigee Edge 8

Returns the owner of an app.

Parameters

\Apigee\Edge\Api\Management\Entity\AppInterface $app: App entity.

Return value

string Either developer id (UUID) or company name.

Overrides AppCacheInterface::getAppOwner

1 call to AppCache::getAppOwner()
AppCache::prepareCacheItem in src/Entity/Controller/Cache/AppCache.php
Generates cache items for an entity.

File

src/Entity/Controller/Cache/AppCache.php, line 82

Class

AppCache
Default app cache implementation for app controllers.

Namespace

Drupal\apigee_edge\Entity\Controller\Cache

Code

public function getAppOwner(AppInterface $app) : string {
  if ($app instanceof DeveloperAppInterface) {
    return $app
      ->getDeveloperId();
  }
  elseif ($app instanceof CompanyAppInterface) {
    return $app
      ->getCompanyName();
  }
  throw new RuntimeException('Unable to identify app owner.');
}