|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
/* |
|
4
|
|
|
* This file is part of the Veslo project <https://github.com/symfony-doge/veslo>. |
|
5
|
|
|
* |
|
6
|
|
|
* (C) 2019 Pavel Petrov <[email protected]>. |
|
7
|
|
|
* |
|
8
|
|
|
* For the full copyright and license information, please view the LICENSE |
|
9
|
|
|
* file that was distributed with this source code. |
|
10
|
|
|
* |
|
11
|
|
|
* @license https://opensource.org/licenses/GPL-3.0 GPL-3.0 |
|
12
|
|
|
*/ |
|
13
|
|
|
|
|
14
|
|
|
declare(strict_types=1); |
|
15
|
|
|
|
|
16
|
|
|
namespace Veslo\AnthillBundle\Dto\Vacancy\Parser; |
|
17
|
|
|
|
|
18
|
|
|
use Veslo\AnthillBundle\Dto\Vacancy\LocationDto; |
|
19
|
|
|
use Veslo\AnthillBundle\Dto\Vacancy\RawDto; |
|
20
|
|
|
use Veslo\AnthillBundle\Dto\Vacancy\ScannerDto; |
|
21
|
|
|
|
|
22
|
|
|
/** |
|
23
|
|
|
* Context of parsed vacancy data for analysis |
|
24
|
|
|
* |
|
25
|
|
|
* This is just a raw data from specific website, it is not compatible with any project schema |
|
26
|
|
|
* Decisions which data will be stored in actual schema are performed at collecting stage |
|
27
|
|
|
*/ |
|
28
|
|
|
class ParsedDto |
|
29
|
|
|
{ |
|
30
|
|
|
/** |
|
31
|
|
|
* Context of parsed vacancy data for analysis |
|
32
|
|
|
* |
|
33
|
|
|
* @var RawDto |
|
34
|
|
|
*/ |
|
35
|
|
|
private $vacancy; |
|
36
|
|
|
|
|
37
|
|
|
/** |
|
38
|
|
|
* Context of executed scanner |
|
39
|
|
|
* |
|
40
|
|
|
* @var ScannerDto |
|
41
|
|
|
*/ |
|
42
|
|
|
private $scanner; |
|
43
|
|
|
|
|
44
|
|
|
/** |
|
45
|
|
|
* Context of vacancy location from internet |
|
46
|
|
|
* |
|
47
|
|
|
* @var LocationDto |
|
48
|
|
|
*/ |
|
49
|
|
|
private $location; |
|
50
|
|
|
|
|
51
|
|
|
/** |
|
52
|
|
|
* Sets context of parsed vacancy data for analysis |
|
53
|
|
|
* |
|
54
|
|
|
* @param RawDto $vacancy Context of parsed vacancy data for analysis |
|
55
|
|
|
* |
|
56
|
|
|
* @return void |
|
57
|
|
|
*/ |
|
58
|
|
|
public function setVacancy(RawDto $vacancy): void |
|
59
|
|
|
{ |
|
60
|
|
|
$this->vacancy = $vacancy; |
|
61
|
|
|
} |
|
62
|
|
|
|
|
63
|
|
|
/** |
|
64
|
|
|
* Returns context of parsed vacancy data for analysis |
|
65
|
|
|
* |
|
66
|
|
|
* @return RawDto|null |
|
67
|
|
|
*/ |
|
68
|
|
|
public function getVacancy(): ?RawDto |
|
69
|
|
|
{ |
|
70
|
|
|
return $this->vacancy; |
|
71
|
|
|
} |
|
72
|
|
|
|
|
73
|
|
|
/** |
|
74
|
|
|
* Sets context of executed scanner |
|
75
|
|
|
* |
|
76
|
|
|
* @param ScannerDto $scanner Context of executed scanner |
|
77
|
|
|
* |
|
78
|
|
|
* @return void |
|
79
|
|
|
*/ |
|
80
|
|
|
public function setScanner(ScannerDto $scanner): void |
|
81
|
|
|
{ |
|
82
|
|
|
$this->scanner = $scanner; |
|
83
|
|
|
} |
|
84
|
|
|
|
|
85
|
|
|
/** |
|
86
|
|
|
* Returns context of executed scanner |
|
87
|
|
|
* |
|
88
|
|
|
* @return ScannerDto|null |
|
89
|
|
|
*/ |
|
90
|
|
|
public function getScanner(): ?ScannerDto |
|
91
|
|
|
{ |
|
92
|
|
|
return $this->scanner; |
|
93
|
|
|
} |
|
94
|
|
|
|
|
95
|
|
|
/** |
|
96
|
|
|
* Sets context of vacancy location from internet |
|
97
|
|
|
* |
|
98
|
|
|
* @param LocationDto $location Context of vacancy location from internet |
|
99
|
|
|
* |
|
100
|
|
|
* @return void |
|
101
|
|
|
*/ |
|
102
|
|
|
public function setLocation(LocationDto $location): void |
|
103
|
|
|
{ |
|
104
|
|
|
$this->location = $location; |
|
105
|
|
|
} |
|
106
|
|
|
|
|
107
|
|
|
/** |
|
108
|
|
|
* Returns context of vacancy location from internet |
|
109
|
|
|
* |
|
110
|
|
|
* @return LocationDto|null |
|
111
|
|
|
*/ |
|
112
|
|
|
public function getLocation(): ?LocationDto |
|
113
|
|
|
{ |
|
114
|
|
|
return $this->location; |
|
115
|
|
|
} |
|
116
|
|
|
} |
|
117
|
|
|
|