You are here

protected function MongodbRouterRouteProvider::getRouteFromArray in MongoDB 8

Creates a Route object from an array.

Parameters

array $r:

Return value

\Symfony\Component\Routing\Route

2 calls to MongodbRouterRouteProvider::getRouteFromArray()
MongodbRouterRouteProvider::getRoutesByNames in src/MongodbRouterRouteProvider.php
Find many routes by their names using the provided list of names.
MongodbRouterRouteProvider::getRoutesByPath in src/MongodbRouterRouteProvider.php
Get all routes which match a certain pattern.

File

src/MongodbRouterRouteProvider.php, line 108
Contains Drupal\mongodb\MongodbRouterRouteProvider.

Class

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

Namespace

Drupal\mongodb

Code

protected function getRouteFromArray(array $r) {
  $r += array(
    'defaults' => array(),
    'requirements' => array(),
    'options' => array(),
    'host' => '',
    'schemes' => array(),
    'methods' => array(
      'GET',
      'POST',
    ),
    'condition' => '',
    'path' => $r['pattern_outline'],
  );
  return new Route($r['path'], $r['defaults'], $r['requirements'], $r['options'], $r['host'], $r['schemes'], $r['methods'], $r['condition']);
}