RouteProviderInterface.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. namespace Drupal\Core\Routing;
  3. use Symfony\Cmf\Component\Routing\RouteProviderInterface as RouteProviderBaseInterface;
  4. /**
  5. * Extends the router provider interface
  6. *
  7. * @see \Symfony\Cmf\Component\Routing
  8. */
  9. interface RouteProviderInterface extends RouteProviderBaseInterface {
  10. /**
  11. * Get all routes which match a certain pattern.
  12. *
  13. * @param string $pattern
  14. * The route pattern to search for (contains {} as placeholders).
  15. *
  16. * @return \Symfony\Component\Routing\RouteCollection
  17. * Returns a route collection of matching routes. The collection may be
  18. * empty and will be sorted from highest to lowest fit (match of path parts)
  19. * and then in ascending order by route name for routes with the same fit.
  20. */
  21. public function getRoutesByPattern($pattern);
  22. /**
  23. * Returns all the routes on the system.
  24. *
  25. * Usage of this method is discouraged for performance reasons. If possible,
  26. * use RouteProviderInterface::getRoutesByNames() or
  27. * RouteProviderInterface::getRoutesByPattern() instead.
  28. *
  29. * @return \Symfony\Component\Routing\Route[]
  30. * An iterator of routes keyed by route name.
  31. */
  32. public function getAllRoutes();
  33. /**
  34. * Resets the route provider object.
  35. */
  36. public function reset();
  37. }