/** * @param Request $request * * @return array a list of PHPCR-ODM ids */ public function getCandidates(Request $request) { if (false !== strpos($request->getPathInfo(), ':')) { return array(); } return $this->candidatesStrategy->getCandidates($request); }
/** * {@inheritdoc} */ public function getRouteCollectionForRequest(Request $request) { $collection = new RouteCollection(); $candidates = $this->candidatesStrategy->getCandidates($request); if (0 === count($candidates)) { return $collection; } $routes = $this->routeManager->findVisibleByRoutePatterns($candidates); foreach ($routes as $route) { $collection->add($route->getName(), $route); } return $collection; }
/** * {@inheritDoc} */ public function getRouteCollectionForRequest(Request $request) { $collection = new RouteCollection(); $candidates = $this->candidatesStrategy->getCandidates($request); if (empty($candidates)) { return $collection; } $routes = $this->getRouteRepository()->findByStaticPrefix($candidates, array('position' => 'ASC')); /** @var $route Route */ foreach ($routes as $route) { $collection->add($route->getName(), $route); } return $collection; }