1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Jobles\Core\Job; |
4
|
|
|
|
5
|
|
|
use Jobles\Core\Index\Index; |
6
|
|
|
|
7
|
|
|
final class Job |
8
|
|
|
{ |
9
|
|
|
|
10
|
|
|
/** |
11
|
|
|
* @var string |
12
|
|
|
*/ |
13
|
|
|
private $key; |
14
|
|
|
|
15
|
|
|
/** |
16
|
|
|
* @var Index |
17
|
|
|
*/ |
18
|
|
|
private $index; |
19
|
|
|
|
20
|
|
|
/** |
21
|
|
|
* @var string |
22
|
|
|
*/ |
23
|
|
|
private $title; |
24
|
|
|
|
25
|
|
|
/** |
26
|
|
|
* @var string |
27
|
|
|
*/ |
28
|
|
|
private $company; |
29
|
|
|
|
30
|
|
|
/** |
31
|
|
|
* @var string |
32
|
|
|
*/ |
33
|
|
|
private $salaryCurrencyCode; |
34
|
|
|
|
35
|
|
|
/** |
36
|
|
|
* @var float |
37
|
|
|
*/ |
38
|
|
|
private $salaryMin; |
39
|
|
|
|
40
|
|
|
/** |
41
|
|
|
* @var float |
42
|
|
|
*/ |
43
|
|
|
private $salaryMax; |
44
|
|
|
|
45
|
|
|
/** |
46
|
|
|
* @var string |
47
|
|
|
*/ |
48
|
|
|
private $city; |
49
|
|
|
|
50
|
|
|
/** |
51
|
|
|
* @var string |
52
|
|
|
*/ |
53
|
|
|
private $state; |
54
|
|
|
|
55
|
|
|
/** |
56
|
|
|
* @var string |
57
|
|
|
*/ |
58
|
|
|
private $country; |
59
|
|
|
|
60
|
|
|
/** |
61
|
|
|
* @var string |
62
|
|
|
*/ |
63
|
|
|
private $source; |
64
|
|
|
|
65
|
|
|
/** |
66
|
|
|
* @var \DateTime |
67
|
|
|
*/ |
68
|
|
|
private $date; |
69
|
|
|
|
70
|
|
|
/** |
71
|
|
|
* @var string |
72
|
|
|
*/ |
73
|
|
|
private $snippet; |
74
|
|
|
|
75
|
|
|
/** |
76
|
|
|
* @var string |
77
|
|
|
*/ |
78
|
|
|
private $description; |
79
|
|
|
|
80
|
|
|
/** |
81
|
|
|
* @var string |
82
|
|
|
*/ |
83
|
|
|
private $viewUrl; |
84
|
|
|
|
85
|
|
|
/** |
86
|
|
|
* @var string |
87
|
|
|
*/ |
88
|
|
|
private $applyUrl; |
89
|
|
|
|
90
|
|
|
/** |
91
|
|
|
* @var bool |
92
|
|
|
*/ |
93
|
|
|
private $featured; |
94
|
|
|
|
95
|
34 |
|
public function __construct() |
96
|
|
|
{ |
97
|
34 |
|
$this->key = ''; |
98
|
34 |
|
$this->index = new Index('', '', '', ''); |
99
|
34 |
|
$this->title = ''; |
100
|
34 |
|
$this->company = ''; |
101
|
34 |
|
$this->salaryCurrencyCode = ''; |
102
|
34 |
|
$this->salaryMin = 0; |
|
|
|
|
103
|
34 |
|
$this->salaryMax = 0; |
|
|
|
|
104
|
34 |
|
$this->city = ''; |
105
|
34 |
|
$this->state = ''; |
106
|
34 |
|
$this->country = ''; |
107
|
34 |
|
$this->source = ''; |
108
|
34 |
|
$this->date = new \DateTime; |
109
|
34 |
|
$this->snippet = ''; |
110
|
34 |
|
$this->description = ''; |
111
|
34 |
|
$this->viewUrl = ''; |
112
|
34 |
|
$this->applyUrl = ''; |
113
|
34 |
|
$this->featured = false; |
114
|
34 |
|
} |
115
|
|
|
|
116
|
|
|
/** |
117
|
|
|
* @return string |
118
|
|
|
*/ |
119
|
2 |
|
public function getKey() : string |
120
|
|
|
{ |
121
|
2 |
|
return $this->key; |
122
|
|
|
} |
123
|
|
|
|
124
|
|
|
/** |
125
|
|
|
* @param string $key |
126
|
|
|
* |
127
|
|
|
* @return Job |
128
|
|
|
*/ |
129
|
18 |
|
public function setKey(string $key) |
130
|
|
|
{ |
131
|
18 |
|
$this->key = $key; |
132
|
|
|
|
133
|
18 |
|
return $this; |
134
|
|
|
} |
135
|
|
|
|
136
|
|
|
/** |
137
|
|
|
* @return Index |
138
|
|
|
*/ |
139
|
2 |
|
public function getIndex() : Index |
140
|
|
|
{ |
141
|
2 |
|
return $this->index; |
142
|
|
|
} |
143
|
|
|
|
144
|
|
|
/** |
145
|
|
|
* @param Index $index |
146
|
|
|
* |
147
|
|
|
* @return Job |
148
|
|
|
*/ |
149
|
18 |
|
public function setIndex(Index $index) : Job |
150
|
|
|
{ |
151
|
18 |
|
$this->index = $index; |
152
|
|
|
|
153
|
18 |
|
return $this; |
154
|
|
|
} |
155
|
|
|
|
156
|
|
|
/** |
157
|
|
|
* @return string |
158
|
|
|
*/ |
159
|
4 |
|
public function getTitle() : string |
160
|
|
|
{ |
161
|
4 |
|
return $this->title; |
162
|
|
|
} |
163
|
|
|
|
164
|
|
|
/** |
165
|
|
|
* @param string $title |
166
|
|
|
* |
167
|
|
|
* @return Job |
168
|
|
|
*/ |
169
|
27 |
|
public function setTitle(string $title) : Job |
170
|
|
|
{ |
171
|
27 |
|
$this->title = $title; |
172
|
|
|
|
173
|
27 |
|
return $this; |
174
|
|
|
} |
175
|
|
|
|
176
|
|
|
/** |
177
|
|
|
* @return string |
178
|
|
|
*/ |
179
|
2 |
|
public function getCompany() : string |
180
|
|
|
{ |
181
|
2 |
|
return $this->company; |
182
|
|
|
} |
183
|
|
|
|
184
|
|
|
/** |
185
|
|
|
* @param string $company |
186
|
|
|
* |
187
|
|
|
* @return Job |
188
|
|
|
*/ |
189
|
18 |
|
public function setCompany(string $company) : Job |
190
|
|
|
{ |
191
|
18 |
|
$this->company = $company; |
192
|
|
|
|
193
|
18 |
|
return $this; |
194
|
|
|
} |
195
|
|
|
|
196
|
|
|
/** |
197
|
|
|
* @return string |
198
|
|
|
*/ |
199
|
2 |
|
public function getSalaryCurrencyCode() : string |
200
|
|
|
{ |
201
|
2 |
|
return $this->salaryCurrencyCode; |
202
|
|
|
} |
203
|
|
|
|
204
|
|
|
/** |
205
|
|
|
* @param string $salaryCurrencyCode |
206
|
|
|
* |
207
|
|
|
* @return Job |
208
|
|
|
*/ |
209
|
18 |
|
public function setSalaryCurrencyCode(string $salaryCurrencyCode) : Job |
210
|
|
|
{ |
211
|
18 |
|
$this->salaryCurrencyCode = $salaryCurrencyCode; |
212
|
|
|
|
213
|
18 |
|
return $this; |
214
|
|
|
} |
215
|
|
|
|
216
|
|
|
/** |
217
|
|
|
* @return string |
218
|
|
|
*/ |
219
|
2 |
|
public function getSalaryMin() : string |
220
|
|
|
{ |
221
|
2 |
|
return $this->salaryMin; |
222
|
|
|
} |
223
|
|
|
|
224
|
|
|
/** |
225
|
|
|
* @param string $salaryMin |
226
|
|
|
* |
227
|
|
|
* @return Job |
228
|
|
|
*/ |
229
|
18 |
|
public function setSalaryMin(string $salaryMin) : Job |
230
|
|
|
{ |
231
|
18 |
|
$this->salaryMin = $salaryMin; |
|
|
|
|
232
|
|
|
|
233
|
18 |
|
return $this; |
234
|
|
|
} |
235
|
|
|
|
236
|
|
|
/** |
237
|
|
|
* @return string |
238
|
|
|
*/ |
239
|
2 |
|
public function getSalaryMax() : string |
240
|
|
|
{ |
241
|
2 |
|
return $this->salaryMax; |
242
|
|
|
} |
243
|
|
|
|
244
|
|
|
/** |
245
|
|
|
* @param string $salaryMax |
246
|
|
|
* |
247
|
|
|
* @return Job |
248
|
|
|
*/ |
249
|
18 |
|
public function setSalaryMax(string $salaryMax) : Job |
250
|
|
|
{ |
251
|
18 |
|
$this->salaryMax = $salaryMax; |
|
|
|
|
252
|
|
|
|
253
|
18 |
|
return $this; |
254
|
|
|
} |
255
|
|
|
|
256
|
|
|
/** |
257
|
|
|
* @return string |
258
|
|
|
*/ |
259
|
2 |
|
public function getCity() : string |
260
|
|
|
{ |
261
|
2 |
|
return $this->city; |
262
|
|
|
} |
263
|
|
|
|
264
|
|
|
/** |
265
|
|
|
* @param string $city |
266
|
|
|
* |
267
|
|
|
* @return Job |
268
|
|
|
*/ |
269
|
18 |
|
public function setCity(string $city) : Job |
270
|
|
|
{ |
271
|
18 |
|
$this->city = $city; |
272
|
|
|
|
273
|
18 |
|
return $this; |
274
|
|
|
} |
275
|
|
|
|
276
|
|
|
/** |
277
|
|
|
* @return string |
278
|
|
|
*/ |
279
|
2 |
|
public function getState() : string |
280
|
|
|
{ |
281
|
2 |
|
return $this->state; |
282
|
|
|
} |
283
|
|
|
|
284
|
|
|
/** |
285
|
|
|
* @param string $state |
286
|
|
|
* |
287
|
|
|
* @return Job |
288
|
|
|
*/ |
289
|
18 |
|
public function setState(string $state) : Job |
290
|
|
|
{ |
291
|
18 |
|
$this->state = $state; |
292
|
|
|
|
293
|
18 |
|
return $this; |
294
|
|
|
} |
295
|
|
|
|
296
|
|
|
/** |
297
|
|
|
* @return string |
298
|
|
|
*/ |
299
|
2 |
|
public function getCountry() : string |
300
|
|
|
{ |
301
|
2 |
|
return $this->country; |
302
|
|
|
} |
303
|
|
|
|
304
|
|
|
/** |
305
|
|
|
* @param string $country |
306
|
|
|
* |
307
|
|
|
* @return Job |
308
|
|
|
*/ |
309
|
18 |
|
public function setCountry(string $country) : Job |
310
|
|
|
{ |
311
|
18 |
|
$this->country = $country; |
312
|
|
|
|
313
|
18 |
|
return $this; |
314
|
|
|
} |
315
|
|
|
|
316
|
|
|
/** |
317
|
|
|
* @return string |
318
|
|
|
*/ |
319
|
2 |
|
public function getSource() : string |
320
|
|
|
{ |
321
|
2 |
|
return $this->source; |
322
|
|
|
} |
323
|
|
|
|
324
|
|
|
/** |
325
|
|
|
* @param string $source |
326
|
|
|
* |
327
|
|
|
* @return Job |
328
|
|
|
*/ |
329
|
18 |
|
public function setSource(string $source) : Job |
330
|
|
|
{ |
331
|
18 |
|
$this->source = $source; |
332
|
|
|
|
333
|
18 |
|
return $this; |
334
|
|
|
} |
335
|
|
|
|
336
|
|
|
/** |
337
|
|
|
* @return \DateTime |
338
|
|
|
*/ |
339
|
2 |
|
public function getDate() : \DateTime |
340
|
|
|
{ |
341
|
2 |
|
return $this->date; |
342
|
|
|
} |
343
|
|
|
|
344
|
|
|
/** |
345
|
|
|
* @param \DateTime $date |
346
|
|
|
* |
347
|
|
|
* @return Job |
348
|
|
|
*/ |
349
|
18 |
|
public function setDate(\DateTime $date) : Job |
350
|
|
|
{ |
351
|
18 |
|
$this->date = $date; |
352
|
|
|
|
353
|
18 |
|
return $this; |
354
|
|
|
} |
355
|
|
|
|
356
|
|
|
/** |
357
|
|
|
* @return string |
358
|
|
|
*/ |
359
|
2 |
|
public function getSnippet() : string |
360
|
|
|
{ |
361
|
2 |
|
return $this->snippet; |
362
|
|
|
} |
363
|
|
|
|
364
|
|
|
/** |
365
|
|
|
* @param string $snippet |
366
|
|
|
* |
367
|
|
|
* @return Job |
368
|
|
|
*/ |
369
|
18 |
|
public function setSnippet(string $snippet) : Job |
370
|
|
|
{ |
371
|
18 |
|
$this->snippet = $snippet; |
372
|
|
|
|
373
|
18 |
|
return $this; |
374
|
|
|
} |
375
|
|
|
|
376
|
|
|
/** |
377
|
|
|
* @return string |
378
|
|
|
*/ |
379
|
2 |
|
public function getDescription() : string |
380
|
|
|
{ |
381
|
2 |
|
return $this->description; |
382
|
|
|
} |
383
|
|
|
|
384
|
|
|
/** |
385
|
|
|
* @param string $description |
386
|
|
|
* |
387
|
|
|
* @return Job |
388
|
|
|
*/ |
389
|
18 |
|
public function setDescription(string $description) : Job |
390
|
|
|
{ |
391
|
18 |
|
$this->description = $description; |
392
|
|
|
|
393
|
18 |
|
return $this; |
394
|
|
|
} |
395
|
|
|
|
396
|
|
|
/** |
397
|
|
|
* @return string |
398
|
|
|
*/ |
399
|
2 |
|
public function getViewUrl() : string |
400
|
|
|
{ |
401
|
2 |
|
return $this->viewUrl; |
402
|
|
|
} |
403
|
|
|
|
404
|
|
|
/** |
405
|
|
|
* @param string $viewUrl |
406
|
|
|
* |
407
|
|
|
* @return Job |
408
|
|
|
*/ |
409
|
18 |
|
public function setViewUrl(string $viewUrl) : Job |
410
|
|
|
{ |
411
|
18 |
|
$this->viewUrl = $viewUrl; |
412
|
|
|
|
413
|
18 |
|
return $this; |
414
|
|
|
} |
415
|
|
|
|
416
|
|
|
/** |
417
|
|
|
* @return string |
418
|
|
|
*/ |
419
|
2 |
|
public function getApplyUrl() : string |
420
|
|
|
{ |
421
|
2 |
|
return $this->applyUrl; |
422
|
|
|
} |
423
|
|
|
|
424
|
|
|
/** |
425
|
|
|
* @param string $applyUrl |
426
|
|
|
* |
427
|
|
|
* @return Job |
428
|
|
|
*/ |
429
|
18 |
|
public function setApplyUrl(string $applyUrl) : Job |
430
|
|
|
{ |
431
|
18 |
|
$this->applyUrl = $applyUrl; |
432
|
|
|
|
433
|
18 |
|
return $this; |
434
|
|
|
} |
435
|
|
|
|
436
|
|
|
/** |
437
|
|
|
* @return boolean |
438
|
|
|
*/ |
439
|
2 |
|
public function isFeatured() : bool |
440
|
|
|
{ |
441
|
2 |
|
return $this->featured; |
442
|
|
|
} |
443
|
|
|
|
444
|
|
|
/** |
445
|
|
|
* @param bool $featured |
446
|
|
|
* |
447
|
|
|
* @return Job |
448
|
|
|
*/ |
449
|
18 |
|
public function setFeatured(bool $featured) : Job |
450
|
|
|
{ |
451
|
18 |
|
$this->featured = $featured; |
452
|
|
|
|
453
|
18 |
|
return $this; |
454
|
|
|
} |
455
|
|
|
} |
456
|
|
|
|
This check looks for assignments to scalar types that may be of the wrong type.
To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.