You are here

protected function ApigeeEdgeFunctionalTestTrait::getApps in Apigee Edge 8

Loads all apps for a given user.

Parameters

string $email: Email address of a user.

Return value

\Drupal\apigee_edge\Entity\DeveloperAppInterface[]|null Array of developer apps of the user or if user does not exist as developer on Apigee Edge.

1 method overrides ApigeeEdgeFunctionalTestTrait::getApps()
DeveloperAppUITestTrait::getApps in tests/src/Functional/DeveloperAppUITestTrait.php
Loads all apps for a given user.

File

tests/src/Traits/ApigeeEdgeFunctionalTestTrait.php, line 192

Class

ApigeeEdgeFunctionalTestTrait
Provides common functionality for the Apigee Edge test classes.

Namespace

Drupal\Tests\apigee_edge\Traits

Code

protected function getApps(string $email) : ?array {
  $developer = Developer::load($email);
  if ($developer) {

    /** @var \Drupal\apigee_edge\Entity\Storage\DeveloperAppStorageInterface $storage */
    $storage = \Drupal::entityTypeManager()
      ->getStorage('developer_app');
    return $storage
      ->loadByDeveloper($developer
      ->uuid());
  }
  return NULL;
}