function RouteProcessor::overwriteRoute

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

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