class Routes in Entity Share 8
Same name and namespace in other branches
- 8.3 modules/entity_share_server/src/Routing/Routes.php \Drupal\entity_share_server\Routing\Routes
- 8.2 modules/entity_share_server/src/Routing/Routes.php \Drupal\entity_share_server\Routing\Routes
Defines dynamic routes.
@internal
Hierarchy
- class \Drupal\entity_share_server\Routing\Routes implements ContainerInjectionInterface
Expanded class hierarchy of Routes
File
- modules/
entity_share_server/ src/ Routing/ Routes.php, line 17
Namespace
Drupal\entity_share_server\RoutingView source
class Routes implements ContainerInjectionInterface {
/**
* The authentication collector.
*
* @var \Drupal\Core\Authentication\AuthenticationCollectorInterface
*/
protected $authCollector;
/**
* List of providers.
*
* @var string[]
*/
protected $providerIds;
/**
* Instantiates a Routes object.
*
* @param \Drupal\Core\Authentication\AuthenticationCollectorInterface $auth_collector
* The authentication provider collector.
*/
public function __construct(AuthenticationCollectorInterface $auth_collector) {
$this->authCollector = $auth_collector;
}
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container) {
/* @var \Drupal\Core\Authentication\AuthenticationCollectorInterface $auth_collector */
$auth_collector = $container
->get('authentication_collector');
return new static($auth_collector);
}
/**
* Provides the entry point route.
*/
public function entryPoint() {
$collection = new RouteCollection();
$route_collection = (new Route('/entity_share', [
RouteObjectInterface::CONTROLLER_NAME => '\\Drupal\\entity_share_server\\Controller\\EntryPoint::index',
]))
->setRequirement('_permission', 'entity_share_server_access_channels')
->setMethods([
'GET',
]);
$route_collection
->addOptions([
'_auth' => $this
->authProviderList(),
]);
$collection
->add('entity_share_server.resource_list', $route_collection);
return $collection;
}
/**
* Build a list of authentication provider ids.
*
* @return string[]
* The list of IDs.
*/
protected function authProviderList() {
if (isset($this->providerIds)) {
return $this->providerIds;
}
$this->providerIds = array_keys($this->authCollector
->getSortedProviders());
return $this->providerIds;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
Routes:: |
protected | property | The authentication collector. | |
Routes:: |
protected | property | List of providers. | |
Routes:: |
protected | function | Build a list of authentication provider ids. | |
Routes:: |
public static | function |
Instantiates a new instance of this class. Overrides ContainerInjectionInterface:: |
|
Routes:: |
public | function | Provides the entry point route. | |
Routes:: |
public | function | Instantiates a Routes object. |