You are here

protected static function RestResourceGetRouteProcessorBC::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 RestResourceGetRouteProcessorBC::overwriteRoute()
RestResourceGetRouteProcessorBC::processOutbound in core/modules/rest/src/RouteProcessor/RestResourceGetRouteProcessorBC.php
Processes the outbound route.

File

core/modules/rest/src/RouteProcessor/RestResourceGetRouteProcessorBC.php, line 70

Class

RestResourceGetRouteProcessorBC
Processes the BC REST routes, to ensure old route names continue to work.

Namespace

Drupal\rest\RouteProcessor

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());
}