public function RouteCollection::getRoot

Gets the root RouteCollection of the tree.

Return value

RouteCollection The root RouteCollection

2 calls to RouteCollection::getRoot()
RouteCollection::addCollection in drupal/core/vendor/symfony/routing/Symfony/Component/Routing/RouteCollection.php
Adds a route collection to the current set of routes (at the end of the current set).
RouteCollection::remove in drupal/core/vendor/symfony/routing/Symfony/Component/Routing/RouteCollection.php
Removes a route or an array of routes by name from all connected collections (this instance and all parents and children).

File

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

Class

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

Namespace

Symfony\Component\Routing

Code

public function getRoot() {
  $parent = $this;
  while ($parent
    ->getParent()) {
    $parent = $parent
      ->getParent();
  }
  return $parent;
}