You are here

public function DeveloperAppCacheFactory::getAppCache in Apigee Edge 8

Returns the same app cache instance for a developer.

Even if the owner is sometime a UUID and sometime an email address.

Parameters

string $owner: Developer id (UUID) or email.

Return value

\Drupal\apigee_edge\Entity\Controller\Cache\AppCacheByOwnerInterface The developer app cache that belongs to this owner.

Overrides AppCacheByOwnerFactoryInterface::getAppCache

File

src/Entity/Controller/Cache/DeveloperAppCacheFactory.php, line 84

Class

DeveloperAppCacheFactory
Developer specific app cache by app owner factory service.

Namespace

Drupal\apigee_edge\Entity\Controller\Cache

Code

public function getAppCache(string $owner) : AppCacheByOwnerInterface {
  if ($this->emailValidator
    ->isValid($owner)) {

    /** @var \Drupal\apigee_edge\Entity\Developer|null $developer */
    $developer = $this->entityTypeManager
      ->getStorage('developer')
      ->load($owner);
    if ($developer === NULL) {
      throw new DeveloperDoesNotExistException($owner);
    }
    $owner = $developer
      ->getDeveloperId();
  }
  return $this->appCacheByOwnerFactory
    ->getAppCache($owner);
}