You are here

protected static function RouteProcessor::overwriteRoute in Drupal 8

Overwrites one route's metadata with the other's.

Parameters

\Symfony\Component\Routing\Route $target_route: The route whose metadata to overwrite.

\Symfony\Component\Routing\Route $source_route: The route whose metadata to read from.

See also

\Symfony\Component\Routing\Route

1 call to RouteProcessor::overwriteRoute()
RouteProcessor::processOutbound in core/modules/path/src/Routing/RouteProcessor.php
Processes the outbound route.

File

core/modules/path/src/Routing/RouteProcessor.php, line 60

Class

RouteProcessor
Processes the backwards-compatibility layer for path alias routes.

Namespace

Drupal\path\Routing

Code

protected static function overwriteRoute(Route $target_route, Route $source_route) {
  $target_route
    ->setPath($source_route
    ->getPath());
  $target_route
    ->setDefaults($source_route
    ->getDefaults());
  $target_route
    ->setRequirements($source_route
    ->getRequirements());
  $target_route
    ->setOptions($source_route
    ->getOptions());
  $target_route
    ->setHost($source_route
    ->getHost());
  $target_route
    ->setSchemes($source_route
    ->getSchemes());
  $target_route
    ->setMethods($source_route
    ->getMethods());
}