public function RouteCollection::__clone

File

drupal/core/vendor/symfony/routing/Symfony/Component/Routing/RouteCollection.php, line 46

Class

RouteCollection
A RouteCollection represents a set of Route instances as a tree structure.

Namespace

Symfony\Component\Routing

Code

public function __clone() {
  foreach ($this->routes as $name => $route) {
    $this->routes[$name] = clone $route;
    if ($route instanceof RouteCollection) {
      $this->routes[$name]
        ->setParent($this);
    }
  }
}