1 | <?php |
||
25 | class Parameter |
||
26 | { |
||
27 | /** |
||
28 | * instance of the request class |
||
29 | * |
||
30 | * @var Request |
||
31 | */ |
||
32 | |||
33 | protected $_request; |
||
34 | |||
35 | /** |
||
36 | * array of the parameter |
||
37 | * |
||
38 | * @var array |
||
39 | */ |
||
40 | |||
41 | protected $_parameterArray = []; |
||
42 | |||
43 | /** |
||
44 | * constructor of the class |
||
45 | * |
||
46 | * @since 2.4.0 |
||
47 | * |
||
48 | * @param Request $request instance of the request class |
||
49 | */ |
||
50 | |||
51 | 160 | public function __construct(Request $request) |
|
55 | |||
56 | /** |
||
57 | * init the class |
||
58 | * |
||
59 | * @since 2.4.0 |
||
60 | */ |
||
61 | |||
62 | 160 | public function init() : void |
|
76 | |||
77 | /** |
||
78 | * get the first parameter |
||
79 | * |
||
80 | * @since 3.1.0 |
||
81 | * |
||
82 | * @return string|null |
||
83 | */ |
||
84 | |||
85 | 80 | public function getFirst() : ?string |
|
89 | |||
90 | /** |
||
91 | * get the first sub parameter |
||
92 | * |
||
93 | * @since 3.1.0 |
||
94 | * |
||
95 | * @return int|null |
||
96 | */ |
||
97 | |||
98 | 16 | public function getFirstSub() : ?int |
|
102 | |||
103 | /** |
||
104 | * get the second parameter |
||
105 | * |
||
106 | * @since 3.1.0 |
||
107 | * |
||
108 | * @return string|null |
||
109 | */ |
||
110 | |||
111 | 40 | public function getSecond() : ?string |
|
115 | |||
116 | /** |
||
117 | * get the second sub parameter |
||
118 | * |
||
119 | * @since 3.1.0 |
||
120 | * |
||
121 | * @return int|null |
||
122 | */ |
||
123 | |||
124 | 16 | public function getSecondSub() : ?int |
|
128 | |||
129 | /** |
||
130 | * get the third parameter |
||
131 | * |
||
132 | * @since 3.1.0 |
||
133 | * |
||
134 | * @return string|null |
||
135 | */ |
||
136 | |||
137 | 26 | public function getThird() : ?string |
|
141 | |||
142 | /** |
||
143 | * get the third sub parameter |
||
144 | * |
||
145 | * @since 3.1.0 |
||
146 | * |
||
147 | * @return int|null |
||
148 | */ |
||
149 | |||
150 | 21 | public function getThirdSub() : ?int |
|
154 | |||
155 | /** |
||
156 | * get the fourth parameter |
||
157 | * |
||
158 | * @since 3.1.0 |
||
159 | * |
||
160 | * @return string|null |
||
161 | */ |
||
162 | |||
163 | 21 | public function getFourth() : ?string |
|
167 | |||
168 | /** |
||
169 | * get the fourth sub parameter |
||
170 | * |
||
171 | * @since 3.1.0 |
||
172 | * |
||
173 | * @return int|null |
||
174 | */ |
||
175 | |||
176 | 16 | public function getFourthSub() : ?int |
|
180 | |||
181 | /** |
||
182 | * get the last parameter |
||
183 | * |
||
184 | * @since 2.4.0 |
||
185 | * |
||
186 | * @return string|null |
||
187 | */ |
||
188 | |||
189 | 32 | public function getLast() : ?string |
|
200 | |||
201 | /** |
||
202 | * get the last sub parameter |
||
203 | * |
||
204 | * @since 3.1.0 |
||
205 | * |
||
206 | * @return int|null |
||
207 | */ |
||
208 | |||
209 | 16 | public function getLastSub() : ?int |
|
220 | |||
221 | /** |
||
222 | * get the admin parameter |
||
223 | * |
||
224 | * @since 2.4.0 |
||
225 | * |
||
226 | * @return string|null |
||
227 | */ |
||
228 | |||
229 | 64 | public function getAdmin() : ?string |
|
237 | |||
238 | /** |
||
239 | * get the table parameter |
||
240 | * |
||
241 | * @since 2.4.0 |
||
242 | * |
||
243 | * @return string|null |
||
244 | */ |
||
245 | |||
246 | 32 | public function getTable() : ?string |
|
254 | |||
255 | /** |
||
256 | * get the alias parameter |
||
257 | * |
||
258 | * @since 2.4.0 |
||
259 | * |
||
260 | * @return string|null |
||
261 | */ |
||
262 | |||
263 | 16 | public function getAlias() : ?string |
|
271 | |||
272 | /** |
||
273 | * get the id parameter |
||
274 | * |
||
275 | * @since 2.4.0 |
||
276 | * |
||
277 | * @return int|null |
||
278 | */ |
||
279 | |||
280 | 16 | public function getId() : ?int |
|
288 | |||
289 | /** |
||
290 | * get the token parameter |
||
291 | * |
||
292 | * @since 2.4.0 |
||
293 | * |
||
294 | * @return string|null |
||
295 | */ |
||
296 | |||
297 | 16 | public function getToken() : ?string |
|
306 | |||
307 | /** |
||
308 | * get the parameter by key |
||
309 | * |
||
310 | * @since 3.1.0 |
||
311 | * |
||
312 | * @param int $key |
||
313 | * |
||
314 | * @return string|null |
||
315 | */ |
||
316 | |||
317 | 128 | protected function _getParameter(int $key = null) : ?string |
|
325 | |||
326 | /** |
||
327 | * get the parameter sub by key |
||
328 | * |
||
329 | * @since 3.1.0 |
||
330 | * |
||
331 | * @param int $key |
||
332 | * |
||
333 | * @return int|null |
||
334 | */ |
||
335 | |||
336 | 69 | protected function _getParameterSub(int $key = null) : ?int |
|
344 | } |
||
345 |
In PHP, under loose comparison (like
==
, or!=
, orswitch
conditions), values of different types might be equal.For
string
values, the empty string''
is a special case, in particular the following results might be unexpected: