StackedRouteMatchInterface.php 1.14 KB
Newer Older
1 2 3 4
<?php

namespace Drupal\Core\Routing;

5 6
use Symfony\Component\HttpFoundation\Request;

7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
/**
 * Defines an interface for a stack of route matches.
 *
 * This could be for example used on exception pages.
 */
interface StackedRouteMatchInterface extends RouteMatchInterface {

  /**
   * Gets the current route match.
   *
   * @return \Drupal\Core\Routing\RouteMatchInterface
   */
  public function getCurrentRouteMatch();

  /**
   * Gets the master route match..
   *
   * @return \Drupal\Core\Routing\RouteMatchInterface
   */
  public function getMasterRouteMatch();

  /**
   * Returns the parent route match of the current.
   *
31
   * @return \Drupal\Core\Routing\RouteMatchInterface|null
32 33 34 35
   *   The parent route match or NULL, if it the master route match.
   */
  public function getParentRouteMatch();

36 37 38
  /**
   * Returns a route match from a given request, if possible.
   *
39
   * @param \Symfony\Component\HttpFoundation\Request $request
40 41
   *   The request.
   *
42
   * @return \Drupal\Core\Routing\RouteMatchInterface|null
43
   *   The matching route match, or NULL if there is no matching one.
44 45
   */
  public function getRouteMatchFromRequest(Request $request);
46

47
}