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