|
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\SanityBundle\Dto\Vacancy; |
|
17
|
|
|
|
|
18
|
|
|
use DateTimeInterface; |
|
19
|
|
|
|
|
20
|
|
|
/** |
|
21
|
|
|
* Context of vacancy index data |
|
22
|
|
|
*/ |
|
23
|
|
|
class IndexDto |
|
24
|
|
|
{ |
|
25
|
|
|
/** |
|
26
|
|
|
* Vacancy index value |
|
27
|
|
|
* |
|
28
|
|
|
* @var float |
|
29
|
|
|
*/ |
|
30
|
|
|
private $value; |
|
31
|
|
|
|
|
32
|
|
|
/** |
|
33
|
|
|
* Vacancy identifier to which sanity index belongs to |
|
34
|
|
|
* |
|
35
|
|
|
* @var int |
|
36
|
|
|
*/ |
|
37
|
|
|
private $vacancyId; |
|
38
|
|
|
|
|
39
|
|
|
/** |
|
40
|
|
|
* Vacancy tags |
|
41
|
|
|
* |
|
42
|
|
|
* @var TagDto[] |
|
43
|
|
|
*/ |
|
44
|
|
|
private $tags; |
|
45
|
|
|
|
|
46
|
|
|
/** |
|
47
|
|
|
* Date and time when sanity index was created |
|
48
|
|
|
* |
|
49
|
|
|
* @var DateTimeInterface |
|
50
|
|
|
*/ |
|
51
|
|
|
private $indexationDate; |
|
52
|
|
|
|
|
53
|
|
|
/** |
|
54
|
|
|
* IndexDto constructor. |
|
55
|
|
|
*/ |
|
56
|
|
|
public function __construct() |
|
57
|
|
|
{ |
|
58
|
|
|
$this->tags = []; |
|
59
|
|
|
} |
|
60
|
|
|
|
|
61
|
|
|
/** |
|
62
|
|
|
* Returns vacancy index value |
|
63
|
|
|
* |
|
64
|
|
|
* @return float |
|
65
|
|
|
*/ |
|
66
|
|
|
public function getValue(): float |
|
67
|
|
|
{ |
|
68
|
|
|
return $this->value; |
|
69
|
|
|
} |
|
70
|
|
|
|
|
71
|
|
|
/** |
|
72
|
|
|
* Sets vacancy index value |
|
73
|
|
|
* |
|
74
|
|
|
* @param float $value Index value |
|
75
|
|
|
* |
|
76
|
|
|
* @return void |
|
77
|
|
|
*/ |
|
78
|
|
|
public function setValue(float $value): void |
|
79
|
|
|
{ |
|
80
|
|
|
$this->value = $value; |
|
81
|
|
|
} |
|
82
|
|
|
|
|
83
|
|
|
/** |
|
84
|
|
|
* Returns vacancy identifier to which sanity index belongs to |
|
85
|
|
|
* |
|
86
|
|
|
* @return int |
|
87
|
|
|
*/ |
|
88
|
|
|
public function getVacancyId(): int |
|
89
|
|
|
{ |
|
90
|
|
|
return $this->vacancyId; |
|
91
|
|
|
} |
|
92
|
|
|
|
|
93
|
|
|
/** |
|
94
|
|
|
* Sets vacancy identifier to which sanity index belongs to |
|
95
|
|
|
* |
|
96
|
|
|
* @param int $vacancyId Vacancy identifier to which sanity index belongs to |
|
97
|
|
|
* |
|
98
|
|
|
* @return void |
|
99
|
|
|
*/ |
|
100
|
|
|
public function setVacancyId(int $vacancyId): void |
|
101
|
|
|
{ |
|
102
|
|
|
$this->vacancyId = $vacancyId; |
|
103
|
|
|
} |
|
104
|
|
|
|
|
105
|
|
|
/** |
|
106
|
|
|
* Returns vacancy tags |
|
107
|
|
|
* |
|
108
|
|
|
* @return TagDto[] |
|
109
|
|
|
*/ |
|
110
|
|
|
public function getTags(): array |
|
111
|
|
|
{ |
|
112
|
|
|
return $this->tags; |
|
113
|
|
|
} |
|
114
|
|
|
|
|
115
|
|
|
/** |
|
116
|
|
|
* Adds a vacancy tag |
|
117
|
|
|
* |
|
118
|
|
|
* @param TagDto $tag Vacancy tag |
|
119
|
|
|
* |
|
120
|
|
|
* @return void |
|
121
|
|
|
*/ |
|
122
|
|
|
public function addTag(TagDto $tag): void |
|
123
|
|
|
{ |
|
124
|
|
|
$this->tags[] = $tag; |
|
125
|
|
|
} |
|
126
|
|
|
|
|
127
|
|
|
/** |
|
128
|
|
|
* Returns date and time when sanity index was created |
|
129
|
|
|
* |
|
130
|
|
|
* @return DateTimeInterface |
|
131
|
|
|
*/ |
|
132
|
|
|
public function getIndexationDate(): DateTimeInterface |
|
133
|
|
|
{ |
|
134
|
|
|
return $this->indexationDate; |
|
135
|
|
|
} |
|
136
|
|
|
|
|
137
|
|
|
/** |
|
138
|
|
|
* Sets date and time when sanity index was created |
|
139
|
|
|
* |
|
140
|
|
|
* @param DateTimeInterface $indexationDate Date and time when sanity index was created |
|
141
|
|
|
* |
|
142
|
|
|
* @return void |
|
143
|
|
|
*/ |
|
144
|
|
|
public function setIndexationDate(DateTimeInterface $indexationDate): void |
|
145
|
|
|
{ |
|
146
|
|
|
$this->indexationDate = $indexationDate; |
|
147
|
|
|
} |
|
148
|
|
|
} |
|
149
|
|
|
|