You are here

public function ChainRouter::getRouteCollection in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/symfony-cmf/routing/ChainRouter.php \Symfony\Cmf\Component\Routing\ChainRouter::getRouteCollection()

Gets the RouteCollection instance associated with this Router.

Return value

RouteCollection A RouteCollection instance

Overrides RouterInterface::getRouteCollection

File

vendor/symfony-cmf/routing/ChainRouter.php, line 298

Class

ChainRouter
The ChainRouter allows to combine several routers to try in a defined order.

Namespace

Symfony\Cmf\Component\Routing

Code

public function getRouteCollection() {
  if (!$this->routeCollection instanceof RouteCollection) {
    $this->routeCollection = new ChainRouteCollection();
    foreach ($this
      ->all() as $router) {
      $this->routeCollection
        ->addCollection($router
        ->getRouteCollection());
    }
  }
  return $this->routeCollection;
}