1 | <?php |
||
23 | class BadUserRoleException extends AbstractBootstrapException { |
||
24 | |||
25 | /** |
||
26 | * Redirect. |
||
27 | * |
||
28 | * @var string |
||
29 | */ |
||
30 | private $redirect; |
||
31 | |||
32 | /** |
||
33 | * Roles. |
||
34 | * |
||
35 | * @var array |
||
36 | */ |
||
37 | private $roles; |
||
38 | |||
39 | /** |
||
40 | * Route. |
||
41 | * |
||
42 | * @var string |
||
43 | */ |
||
44 | private $route; |
||
45 | |||
46 | /** |
||
47 | * User. |
||
48 | * |
||
49 | * @var UserInterface |
||
50 | */ |
||
51 | private $user; |
||
52 | |||
53 | /** |
||
54 | * Constructor. |
||
55 | * |
||
56 | * @param UserInterface $user The user. |
||
57 | * @param array $roles The roles. |
||
58 | * @param string $route The route. |
||
59 | * @param string $redirect The redirect. |
||
60 | */ |
||
61 | public function __construct(UserInterface $user, array $roles, $route, $redirect) { |
||
68 | |||
69 | /** |
||
70 | * Get the redirect. |
||
71 | * |
||
72 | * @return string Returns the redirect. |
||
73 | */ |
||
74 | public function getRedirect() { |
||
77 | |||
78 | /** |
||
79 | * Get the roles. |
||
80 | * |
||
81 | * @return array Returns the roles. |
||
82 | */ |
||
83 | public function getRoles() { |
||
86 | |||
87 | /** |
||
88 | * Get the route. |
||
89 | * |
||
90 | * @return string Returns the route. |
||
91 | */ |
||
92 | public function getRoute() { |
||
95 | |||
96 | /** |
||
97 | * Get the user. |
||
98 | * |
||
99 | * @return UserInterface Returns the user. |
||
100 | */ |
||
101 | public function getUser() { |
||
104 | |||
105 | /** |
||
106 | * Set the redirect. |
||
107 | * |
||
108 | * @param string $redirect The redirect. |
||
109 | * @return BadUserRoleException Returns this bad user role exception. |
||
110 | */ |
||
111 | protected function setRedirect($redirect) { |
||
115 | |||
116 | /** |
||
117 | * Set the roles; |
||
118 | * |
||
119 | * @param array $roles The roles. |
||
120 | * @return BadUserRoleException Returns this bad user role exception. |
||
121 | */ |
||
122 | public function setRoles(array $roles) { |
||
126 | |||
127 | /** |
||
128 | * Set the route. |
||
129 | * |
||
130 | * @param string $route The route. |
||
131 | * @return BadUserRoleException Returns this bad user role exception. |
||
132 | */ |
||
133 | protected function setRoute($route) { |
||
137 | |||
138 | /** |
||
139 | * Set the user. |
||
140 | * |
||
141 | * @param UserInterface $user The user. |
||
142 | * @return BadUserRoleException Returns this bad user role exception. |
||
143 | */ |
||
144 | protected function setUser(UserInterface $user) { |
||
148 | |||
149 | } |
||
150 |