You are here

protected function DeveloperSync::loadDevelopers in Apigee Edge 8

Loads all Apigee Edge developers indexed my their emails.

Return value

\Drupal\apigee_edge\Entity\DeveloperInterface[] Format: mb_strtolower(email) => Developer

See also

https://www.drupal.org/project/drupal/issues/2490294

1 call to DeveloperSync::loadDevelopers()
DeveloperSync::executeRequest in src/Job/DeveloperSync.php
Executes the request itself.

File

src/Job/DeveloperSync.php, line 106

Class

DeveloperSync
A job that synchronizes Apigee Edge developers and Drupal users.

Namespace

Drupal\apigee_edge\Job

Code

protected function loadDevelopers() : array {

  // Reset developer cache, because the developer may be edited on Apigee
  // Edge.
  \Drupal::entityTypeManager()
    ->getStorage('developer')
    ->resetCache();
  $developers = [];

  /** @var \Drupal\apigee_edge\Entity\DeveloperInterface $developer */
  foreach (Developer::loadMultiple() as $developer) {
    $email = $developer
      ->getEmail();
    if ($this->filter && !preg_match($this->filter, $email)) {
      continue;
    }
    else {
      $developers[mb_strtolower($email)] = $developer;
    }
  }
  return $developers;
}