Version 1
[yaffs-website] / web / core / lib / Drupal / Core / Authentication / AuthenticationCollectorInterface.php
1 <?php
2
3 namespace Drupal\Core\Authentication;
4
5 /**
6  * Interface for collectors of registered authentication providers.
7  */
8 interface AuthenticationCollectorInterface {
9
10   /**
11    * Adds a provider to the array of registered providers.
12    *
13    * @param \Drupal\Core\Authentication\AuthenticationProviderInterface $provider
14    *   The provider object.
15    * @param string $provider_id
16    *   Identifier of the provider.
17    * @param int $priority
18    *   (optional) The provider's priority.
19    * @param bool $global
20    *   (optional) TRUE if the provider is to be applied globally on all routes.
21    *   Defaults to FALSE.
22    */
23   public function addProvider(AuthenticationProviderInterface $provider, $provider_id, $priority = 0, $global = FALSE);
24
25   /**
26    * Returns whether a provider is considered global.
27    *
28    * @param string $provider_id
29    *   The provider ID.
30    *
31    * @return bool
32    *   TRUE if the provider is global, FALSE otherwise.
33    *
34    * @see \Drupal\Core\Authentication\AuthenticationCollectorInterface::addProvider
35    */
36   public function isGlobal($provider_id);
37
38   /**
39    * Returns an authentication provider.
40    *
41    * @param string $provider_id
42    *   The provider ID.
43    *
44    * @return \Drupal\Core\Authentication\AuthenticationProviderInterface|null
45    *   The authentication provider which matches the ID.
46    */
47   public function getProvider($provider_id);
48
49   /**
50    * Returns the sorted array of authentication providers.
51    *
52    * @return \Drupal\Core\Authentication\AuthenticationProviderInterface[]
53    *   An array of authentication provider objects.
54    */
55   public function getSortedProviders();
56
57 }