class RouteProvider in Drupal 8
Same name in this branch
- 8 core/tests/Drupal/KernelTests/RouteProvider.php \Drupal\KernelTests\RouteProvider
- 8 core/modules/simpletest/src/RouteProvider.php \Drupal\simpletest\RouteProvider
- 8 core/lib/Drupal/Core/Routing/RouteProvider.php \Drupal\Core\Routing\RouteProvider
Same name and namespace in other branches
- 9 core/tests/Drupal/KernelTests/RouteProvider.php \Drupal\KernelTests\RouteProvider
Rebuilds the router when the provider is instantiated.
Hierarchy
- class \Drupal\KernelTests\RouteProvider implements \Symfony\Cmf\Component\Routing\PagedRouteProviderInterface, PreloadableRouteProviderInterface uses DependencySerializationTrait
Expanded class hierarchy of RouteProvider
1 file declares its use of RouteProvider
- RouteProvider.php in core/
modules/ simpletest/ src/ RouteProvider.php
File
- core/
tests/ Drupal/ KernelTests/ RouteProvider.php, line 12
Namespace
Drupal\KernelTestsView source
class RouteProvider implements PreloadableRouteProviderInterface, PagedRouteProviderInterface {
use \Drupal\Core\DependencyInjection\DependencySerializationTrait;
/**
* Loads the real route provider from the container and rebuilds the router.
*
* @return \Drupal\Core\Routing\PreloadableRouteProviderInterface|\Symfony\Cmf\Component\Routing\PagedRouteProviderInterface|\Symfony\Component\EventDispatcher\EventSubscriberInterface
* The route provider.
*/
protected function lazyLoadItself() {
if (!isset($this->service)) {
$container = \Drupal::getContainer();
$this->service = $container
->get('simpletest.router.route_provider');
$container
->get('router.builder')
->rebuild();
}
return $this->service;
}
/**
* {@inheritdoc}
*/
public function getRouteCollectionForRequest(Request $request) {
return $this
->lazyLoadItself()
->getRouteCollectionForRequest($request);
}
/**
* {@inheritdoc}
*/
public function getRouteByName($name) {
return $this
->lazyLoadItself()
->getRouteByName($name);
}
/**
* {@inheritdoc}
*/
public function preLoadRoutes($names) {
return $this
->lazyLoadItself()
->preLoadRoutes($names);
}
/**
* {@inheritdoc}
*/
public function getRoutesByNames($names) {
return $this
->lazyLoadItself()
->getRoutesByNames($names);
}
/**
* {@inheritdoc}
*/
public function getCandidateOutlines(array $parts) {
return $this
->lazyLoadItself()
->getCandidateOutlines($parts);
}
/**
* {@inheritdoc}
*/
public function getRoutesByPattern($pattern) {
return $this
->lazyLoadItself()
->getRoutesByPattern($pattern);
}
/**
* {@inheritdoc}
*/
public function routeProviderRouteCompare(array $a, array $b) {
return $this
->lazyLoadItself()
->routeProviderRouteCompare($a, $b);
}
/**
* {@inheritdoc}
*/
public function getAllRoutes() {
return $this
->lazyLoadItself()
->getAllRoutes();
}
/**
* {@inheritdoc}
*/
public function reset() {
return $this
->lazyLoadItself()
->reset();
}
/**
* {@inheritdoc}
*/
public function getRoutesPaged($offset, $length = NULL) {
return $this
->lazyLoadItself()
->getRoutesPaged($offset, $length);
}
/**
* {@inheritdoc}
*/
public function getRoutesCount() {
return $this
->lazyLoadItself()
->getRoutesCount();
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
DependencySerializationTrait:: |
protected | property | An array of entity type IDs keyed by the property name of their storages. | |
DependencySerializationTrait:: |
protected | property | An array of service IDs keyed by property name used for serialization. | |
DependencySerializationTrait:: |
public | function | 1 | |
DependencySerializationTrait:: |
public | function | 2 | |
RouteProvider:: |
public | function |
Returns all the routes on the system. Overrides RouteProviderInterface:: |
|
RouteProvider:: |
public | function | ||
RouteProvider:: |
public | function | Find the route using the provided route name. | |
RouteProvider:: |
public | function | Finds routes that may potentially match the request. | |
RouteProvider:: |
public | function | Find many routes by their names using the provided list of names. | |
RouteProvider:: |
public | function |
Get all routes which match a certain pattern. Overrides RouteProviderInterface:: |
|
RouteProvider:: |
public | function | Determines the total amount of routes. | |
RouteProvider:: |
public | function | Find an amount of routes with an offset and possible a limit. | |
RouteProvider:: |
protected | function | Loads the real route provider from the container and rebuilds the router. | |
RouteProvider:: |
public | function |
Pre-load routes by their names using the provided list of names. Overrides PreloadableRouteProviderInterface:: |
|
RouteProvider:: |
public | function |
Resets the route provider object. Overrides RouteProviderInterface:: |
|
RouteProvider:: |
public | function |