You are here

public function RouteProvider::getRoutesPaged in Drupal 8

Same name in this branch
  1. 8 core/tests/Drupal/KernelTests/RouteProvider.php \Drupal\KernelTests\RouteProvider::getRoutesPaged()
  2. 8 core/lib/Drupal/Core/Routing/RouteProvider.php \Drupal\Core\Routing\RouteProvider::getRoutesPaged()
Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Routing/RouteProvider.php \Drupal\Core\Routing\RouteProvider::getRoutesPaged()

File

core/lib/Drupal/Core/Routing/RouteProvider.php, line 427

Class

RouteProvider
A Route Provider front-end for all Drupal-stored routes.

Namespace

Drupal\Core\Routing

Code

public function getRoutesPaged($offset, $length = NULL) {
  $select = $this->connection
    ->select($this->tableName, 'router')
    ->fields('router', [
    'name',
    'route',
  ]);
  if (isset($length)) {
    $select
      ->range($offset, $length);
  }
  $routes = $select
    ->execute()
    ->fetchAllKeyed();
  $result = [];
  foreach ($routes as $name => $route) {
    $result[$name] = unserialize($route);
  }
  return $result;
}