StackedRouteMatchInterface.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. namespace Drupal\Core\Routing;
  3. use Symfony\Component\HttpFoundation\Request;
  4. /**
  5. * Defines an interface for a stack of route matches.
  6. *
  7. * This could be for example used on exception pages.
  8. */
  9. interface StackedRouteMatchInterface extends RouteMatchInterface {
  10. /**
  11. * Gets the current route match.
  12. *
  13. * @return \Drupal\Core\Routing\RouteMatchInterface
  14. */
  15. public function getCurrentRouteMatch();
  16. /**
  17. * Gets the master route match..
  18. *
  19. * @return \Drupal\Core\Routing\RouteMatchInterface
  20. */
  21. public function getMasterRouteMatch();
  22. /**
  23. * Returns the parent route match of the current.
  24. *
  25. * @return \Drupal\Core\Routing\RouteMatchInterface|null
  26. * The parent route match or NULL, if it the master route match.
  27. */
  28. public function getParentRouteMatch();
  29. /**
  30. * Returns a route match from a given request, if possible.
  31. *
  32. * @param \Symfony\Component\HttpFoundation\Request $request
  33. * The request.
  34. *
  35. * @return \Drupal\Core\Routing\RouteMatchInterface|null
  36. * The matching route match, or NULL if there is no matching one.
  37. */
  38. public function getRouteMatchFromRequest(Request $request);
  39. }