function RouteProvider::getRoutesPaged

Same name in this branch
  1. 8.9.x core/tests/Drupal/KernelTests/RouteProvider.php \Drupal\KernelTests\RouteProvider::getRoutesPaged()
Same name 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;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.