comparison core/lib/Drupal/Core/ParamConverter/ParamNotConvertedException.php @ 0:4c8ae668cc8c

Initial import (non-working)
author Chris Cannam
date Wed, 29 Nov 2017 16:09:58 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:4c8ae668cc8c
1 <?php
2
3 namespace Drupal\Core\ParamConverter;
4
5 /**
6 * Provides an exception class for a request parameter that was not converted.
7 */
8 class ParamNotConvertedException extends \Exception {
9
10 /**
11 * The route name that was not converted.
12 *
13 * @var string
14 */
15 protected $routeName = "";
16
17 /**
18 * The raw parameters that were not converted.
19 *
20 * @var array
21 */
22 protected $rawParameters = [];
23
24 /**
25 * Constructs the ParamNotConvertedException.
26 *
27 * @param string $message
28 * The Exception message to throw.
29 * @param int $code
30 * The Exception code.
31 * @param \Exception $previous
32 * The previous exception used for the exception chaining.
33 * @param string $route_name
34 * The route name that was not converted.
35 * @param array $raw_parameters
36 * The raw parameters that were not converted.
37 */
38 public function __construct($message = "", $code = 0, \Exception $previous = NULL, $route_name = "", array $raw_parameters = []) {
39 parent::__construct($message, $code, $previous);
40 $this->routeName = $route_name;
41 $this->rawParameters = $raw_parameters;
42 }
43
44 /**
45 * Get the route name that was not converted.
46 *
47 * @return string
48 * The route name that was not converted.
49 */
50 public function getRouteName() {
51 return $this->routeName;
52 }
53
54 /**
55 * Get the raw parameters that were not converted.
56 *
57 * @return array
58 * The raw parameters that were not converted.
59 */
60 public function getRawParameters() {
61 return $this->rawParameters;
62 }
63
64 }