public function AuthenticationCollector::getSortedProviders

public AuthenticationCollector::getSortedProviders()

Returns the sorted array of authentication providers.

Return value

\Drupal\Core\Authentication\AuthenticationProviderInterface[] An array of authentication provider objects.

Overrides AuthenticationCollectorInterface::getSortedProviders

File

core/lib/Drupal/Core/Authentication/AuthenticationCollector.php, line 69

Class

AuthenticationCollector
A collector class for authentication providers.

Namespace

Drupal\Core\Authentication

Code

public function getSortedProviders() {
  if (!isset($this->sortedProviders)) {
    // Sort the providers according to priority.
    krsort($this->providerOrders);

    // Merge nested providers from $this->providers into $this->sortedProviders.
    $this->sortedProviders = [];
    foreach ($this->providerOrders as $providers) {
      $this->sortedProviders = array_merge($this->sortedProviders, $providers);
    }
  }

  return $this->sortedProviders;
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Authentication!AuthenticationCollector.php/function/AuthenticationCollector::getSortedProviders/8.1.x