You are here

protected function DeveloperSync::loadUsers in Apigee Edge 8

Loads all Drupal users indexed my their emails.

Return value

\Drupal\user\UserInterface[] Format: mb_strtolower(mail) => User

See also

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

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

File

src/Job/DeveloperSync.php, line 80

Class

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

Namespace

Drupal\apigee_edge\Job

Code

protected function loadUsers() : array {
  $users = [];

  /** @var \Drupal\user\UserInterface $user */
  foreach (User::loadMultiple() as $user) {
    $email = $user
      ->getEmail();
    if (isset($email)) {
      if ($this->filter && !preg_match($this->filter, $email)) {
        continue;
      }
      else {
        $users[mb_strtolower($email)] = $user;
      }
    }
  }
  return $users;
}