Chris@0
|
1 <?php
|
Chris@0
|
2
|
Chris@0
|
3 namespace Drupal\Core\Routing;
|
Chris@0
|
4
|
Chris@0
|
5 /**
|
Chris@0
|
6 * Provides an interface for classes representing the result of routing.
|
Chris@0
|
7 *
|
Chris@0
|
8 * Routing is the process of selecting the best matching candidate from a
|
Chris@0
|
9 * collection of routes for an incoming request. The relevant properties of a
|
Chris@0
|
10 * request include the path as well as a list of raw parameter values derived
|
Chris@0
|
11 * from the URL. If an appropriate route is found, raw parameter values will be
|
Chris@0
|
12 * upcast automatically if possible.
|
Chris@0
|
13 *
|
Chris@0
|
14 * The route match object contains useful information about the selected route
|
Chris@0
|
15 * as well as the raw and upcast parameters derived from the incoming
|
Chris@0
|
16 * request.
|
Chris@0
|
17 *
|
Chris@0
|
18 * @ingroup routing
|
Chris@0
|
19 */
|
Chris@0
|
20 interface RouteMatchInterface {
|
Chris@0
|
21
|
Chris@0
|
22 /**
|
Chris@0
|
23 * Returns the route name.
|
Chris@0
|
24 *
|
Chris@0
|
25 * @return string|null
|
Chris@0
|
26 * The route name. NULL if no route is matched.
|
Chris@0
|
27 */
|
Chris@0
|
28 public function getRouteName();
|
Chris@0
|
29
|
Chris@0
|
30 /**
|
Chris@0
|
31 * Returns the route object.
|
Chris@0
|
32 *
|
Chris@0
|
33 * @return \Symfony\Component\Routing\Route|null
|
Chris@0
|
34 * The route object. NULL if no route is matched.
|
Chris@0
|
35 */
|
Chris@0
|
36 public function getRouteObject();
|
Chris@0
|
37
|
Chris@0
|
38 /**
|
Chris@0
|
39 * Returns the processed value of a named route parameter.
|
Chris@0
|
40 *
|
Chris@0
|
41 * Raw URL parameters are processed by the parameter conversion system, which
|
Chris@0
|
42 * does operations such as converting entity ID parameters to fully-loaded
|
Chris@0
|
43 * entities. For example, the path node/12345 would have a raw node ID
|
Chris@0
|
44 * parameter value of 12345, while the processed parameter value would be the
|
Chris@0
|
45 * corresponding loaded node object.
|
Chris@0
|
46 *
|
Chris@0
|
47 * @param string $parameter_name
|
Chris@0
|
48 * The parameter name.
|
Chris@0
|
49 *
|
Chris@0
|
50 * @return mixed|null
|
Chris@0
|
51 * The parameter value. NULL if the route doesn't define the parameter or
|
Chris@0
|
52 * if the parameter value can't be determined from the request.
|
Chris@0
|
53 *
|
Chris@0
|
54 * @see \Drupal\Core\Routing\RouteMatchInterface::getRawParameter()
|
Chris@0
|
55 */
|
Chris@0
|
56 public function getParameter($parameter_name);
|
Chris@0
|
57
|
Chris@0
|
58 /**
|
Chris@0
|
59 * Returns the bag of all processed route parameters.
|
Chris@0
|
60 *
|
Chris@0
|
61 * Raw URL parameters are processed by the parameter conversion system, which
|
Chris@0
|
62 * does operations such as converting entity ID parameters to fully-loaded
|
Chris@0
|
63 * entities. For example, the path node/12345 would have a raw node ID
|
Chris@0
|
64 * parameter value of 12345, while the processed parameter value would be the
|
Chris@0
|
65 * corresponding loaded node object.
|
Chris@0
|
66 *
|
Chris@0
|
67 * @return \Symfony\Component\HttpFoundation\ParameterBag
|
Chris@0
|
68 * The parameter bag.
|
Chris@0
|
69 *
|
Chris@0
|
70 * @see \Drupal\Core\Routing\RouteMatchInterface::getRawParameters()
|
Chris@0
|
71 */
|
Chris@0
|
72 public function getParameters();
|
Chris@0
|
73
|
Chris@0
|
74 /**
|
Chris@0
|
75 * Returns the raw value of a named route parameter.
|
Chris@0
|
76 *
|
Chris@0
|
77 * @param string $parameter_name
|
Chris@0
|
78 * The parameter name.
|
Chris@0
|
79 *
|
Chris@0
|
80 * @return string|null
|
Chris@0
|
81 * The raw (non-upcast) parameter value. NULL if the route doesn't define
|
Chris@0
|
82 * the parameter or if the raw parameter value can't be determined from the
|
Chris@0
|
83 * request.
|
Chris@0
|
84 *
|
Chris@0
|
85 * @see \Drupal\Core\Routing\RouteMatchInterface::getParameter()
|
Chris@0
|
86 */
|
Chris@0
|
87 public function getRawParameter($parameter_name);
|
Chris@0
|
88
|
Chris@0
|
89 /**
|
Chris@0
|
90 * Returns the bag of all raw route parameters.
|
Chris@0
|
91 *
|
Chris@0
|
92 * @return \Symfony\Component\HttpFoundation\ParameterBag
|
Chris@0
|
93 * The parameter bag.
|
Chris@0
|
94 *
|
Chris@0
|
95 * @see \Drupal\Core\Routing\RouteMatchInterface::getParameters()
|
Chris@0
|
96 */
|
Chris@0
|
97 public function getRawParameters();
|
Chris@0
|
98
|
Chris@0
|
99 }
|