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\Entity\Vacancy\MappedSuperclass; |
17
|
|
|
|
18
|
|
|
use DateTimeInterface; |
19
|
|
|
use Doctrine\ORM\Mapping as ORM; |
20
|
|
|
use Gedmo\Mapping\Annotation as Gedmo; |
21
|
|
|
use Veslo\AnthillBundle\Entity\Vacancy; |
22
|
|
|
|
23
|
|
|
/** |
24
|
|
|
* Surrogate class for managing complexity of main vacancy entity |
25
|
|
|
* Contains base entity fields only, which will be synchronized with data from an external job website |
26
|
|
|
* |
27
|
|
|
* @ORM\MappedSuperclass |
28
|
|
|
* |
29
|
|
|
* @see Vacancy |
30
|
|
|
*/ |
31
|
|
|
abstract class SynchronizableDataFields |
32
|
|
|
{ |
33
|
|
|
/** |
34
|
|
|
* Vacancy URL |
35
|
|
|
* |
36
|
|
|
* @var string |
37
|
|
|
* |
38
|
|
|
* @ORM\Column(name="url", type="string", length=255, options={"comment": "Vacancy URL"}) |
39
|
|
|
* @Gedmo\Versioned |
40
|
|
|
*/ |
41
|
|
|
protected $url; |
42
|
|
|
|
43
|
|
|
/** |
44
|
|
|
* Vacancy region name |
45
|
|
|
* |
46
|
|
|
* @var string |
47
|
|
|
* |
48
|
|
|
* @ORM\Column(name="region_name", type="string", length=255, options={"comment": "Vacancy region name"}) |
49
|
|
|
* @Gedmo\Versioned |
50
|
|
|
*/ |
51
|
|
|
protected $regionName; |
52
|
|
|
|
53
|
|
|
/** |
54
|
|
|
* Vacancy title |
55
|
|
|
* |
56
|
|
|
* @var string |
57
|
|
|
* |
58
|
|
|
* @ORM\Column(name="title", type="string", length=255, options={"comment": "Vacancy title"}) |
59
|
|
|
* @Gedmo\Versioned |
60
|
|
|
*/ |
61
|
|
|
protected $title; |
62
|
|
|
|
63
|
|
|
/** |
64
|
|
|
* Vacancy preview text |
65
|
|
|
* |
66
|
|
|
* @var string|null |
67
|
|
|
* |
68
|
|
|
* @ORM\Column(name="snippet", type="text", nullable=true, options={"comment": "Vacancy preview text"}) |
69
|
|
|
* @Gedmo\Versioned |
70
|
|
|
*/ |
71
|
|
|
protected $snippet; |
72
|
|
|
|
73
|
|
|
/** |
74
|
|
|
* Vacancy text |
75
|
|
|
* |
76
|
|
|
* @var string |
77
|
|
|
* |
78
|
|
|
* @ORM\Column(name="text", type="text", options={"comment": "Vacancy text"}) |
79
|
|
|
* @Gedmo\Versioned |
80
|
|
|
*/ |
81
|
|
|
protected $text; |
82
|
|
|
|
83
|
|
|
/** |
84
|
|
|
* Vacancy salary amount from |
85
|
|
|
* |
86
|
|
|
* @var int|null |
87
|
|
|
* |
88
|
|
|
* @ORM\Column( |
89
|
|
|
* name="salary_from", |
90
|
|
|
* type="integer", |
91
|
|
|
* nullable=true, |
92
|
|
|
* options={"unsigned": true, "comment": "Vacancy salary amount from"} |
93
|
|
|
* ) |
94
|
|
|
* @Gedmo\Versioned |
95
|
|
|
*/ |
96
|
|
|
protected $salaryFrom; |
97
|
|
|
|
98
|
|
|
/** |
99
|
|
|
* Vacancy salary amount to |
100
|
|
|
* |
101
|
|
|
* @var int|null |
102
|
|
|
* |
103
|
|
|
* @ORM\Column( |
104
|
|
|
* name="salary_to", |
105
|
|
|
* type="integer", |
106
|
|
|
* nullable=true, |
107
|
|
|
* options={"unsigned": true, "comment": "Vacancy salary amount to"} |
108
|
|
|
* ) |
109
|
|
|
* @Gedmo\Versioned |
110
|
|
|
*/ |
111
|
|
|
protected $salaryTo; |
112
|
|
|
|
113
|
|
|
/** |
114
|
|
|
* Vacancy salary currency |
115
|
|
|
* |
116
|
|
|
* @var string|null |
117
|
|
|
* |
118
|
|
|
* @ORM\Column( |
119
|
|
|
* name="salary_currency", |
120
|
|
|
* type="string", |
121
|
|
|
* length=255, |
122
|
|
|
* nullable=true, |
123
|
|
|
* options={"comment": "Vacancy salary currency"} |
124
|
|
|
* ) |
125
|
|
|
* @Gedmo\Versioned |
126
|
|
|
*/ |
127
|
|
|
protected $salaryCurrency; |
128
|
|
|
|
129
|
|
|
/** |
130
|
|
|
* Vacancy publication date |
131
|
|
|
* |
132
|
|
|
* @var DateTimeInterface |
133
|
|
|
* |
134
|
|
|
* @ORM\Column(name="publication_date", type="datetime", options={"comment": "Vacancy publication date"}) |
135
|
|
|
*/ |
136
|
|
|
protected $publicationDate; |
137
|
|
|
|
138
|
|
|
/** |
139
|
|
|
* Returns vacancy URL |
140
|
|
|
* |
141
|
|
|
* @return string |
142
|
|
|
*/ |
143
|
|
|
public function getUrl(): string |
144
|
|
|
{ |
145
|
|
|
return $this->url; |
146
|
|
|
} |
147
|
|
|
|
148
|
|
|
/** |
149
|
|
|
* Sets vacancy URL |
150
|
|
|
* |
151
|
|
|
* @param string $url Vacancy URL |
152
|
|
|
* |
153
|
|
|
* @return void |
154
|
|
|
*/ |
155
|
|
|
public function setUrl(string $url): void |
156
|
|
|
{ |
157
|
|
|
$this->url = $url; |
158
|
|
|
} |
159
|
|
|
|
160
|
|
|
/** |
161
|
|
|
* Returns vacancy region name |
162
|
|
|
* |
163
|
|
|
* @return string |
164
|
|
|
*/ |
165
|
|
|
public function getRegionName(): string |
166
|
|
|
{ |
167
|
|
|
return $this->regionName; |
168
|
|
|
} |
169
|
|
|
|
170
|
|
|
/** |
171
|
|
|
* Sets vacancy region name |
172
|
|
|
* |
173
|
|
|
* @param string $regionName Vacancy region name |
174
|
|
|
* |
175
|
|
|
* @return void |
176
|
|
|
*/ |
177
|
|
|
public function setRegionName(string $regionName): void |
178
|
|
|
{ |
179
|
|
|
$this->regionName = $regionName; |
180
|
|
|
} |
181
|
|
|
|
182
|
|
|
/** |
183
|
|
|
* Returns vacancy title |
184
|
|
|
* |
185
|
|
|
* @return string |
186
|
|
|
*/ |
187
|
|
|
public function getTitle(): string |
188
|
|
|
{ |
189
|
|
|
return $this->title; |
190
|
|
|
} |
191
|
|
|
|
192
|
|
|
/** |
193
|
|
|
* Sets vacancy title |
194
|
|
|
* |
195
|
|
|
* @param string $title Vacancy title |
196
|
|
|
* |
197
|
|
|
* @return void |
198
|
|
|
*/ |
199
|
|
|
public function setTitle(string $title): void |
200
|
|
|
{ |
201
|
|
|
$this->title = $title; |
202
|
|
|
} |
203
|
|
|
|
204
|
|
|
/** |
205
|
|
|
* Returns vacancy preview text |
206
|
|
|
* |
207
|
|
|
* @return string|null |
208
|
|
|
*/ |
209
|
|
|
public function getSnippet(): ?string |
210
|
|
|
{ |
211
|
|
|
return $this->snippet; |
212
|
|
|
} |
213
|
|
|
|
214
|
|
|
/** |
215
|
|
|
* Sets vacancy preview text |
216
|
|
|
* |
217
|
|
|
* @param string|null $snippet Vacancy preview text |
218
|
|
|
* |
219
|
|
|
* @return void |
220
|
|
|
*/ |
221
|
|
|
public function setSnippet(?string $snippet): void |
222
|
|
|
{ |
223
|
|
|
$this->snippet = $snippet; |
224
|
|
|
} |
225
|
|
|
|
226
|
|
|
/** |
227
|
|
|
* Returns vacancy text |
228
|
|
|
* |
229
|
|
|
* @return string |
230
|
|
|
*/ |
231
|
|
|
public function getText(): string |
232
|
|
|
{ |
233
|
|
|
return $this->text; |
234
|
|
|
} |
235
|
|
|
|
236
|
|
|
/** |
237
|
|
|
* Sets vacancy text |
238
|
|
|
* |
239
|
|
|
* @param string $text Vacancy text |
240
|
|
|
* |
241
|
|
|
* @return void |
242
|
|
|
*/ |
243
|
|
|
public function setText(string $text): void |
244
|
|
|
{ |
245
|
|
|
$this->text = $text; |
246
|
|
|
} |
247
|
|
|
|
248
|
|
|
/** |
249
|
|
|
* Returns vacancy salary amount from |
250
|
|
|
* |
251
|
|
|
* @return int|null |
252
|
|
|
*/ |
253
|
|
|
public function getSalaryFrom(): ?int |
254
|
|
|
{ |
255
|
|
|
return $this->salaryFrom; |
256
|
|
|
} |
257
|
|
|
|
258
|
|
|
/** |
259
|
|
|
* Sets vacancy salary amount from |
260
|
|
|
* |
261
|
|
|
* @param int|null $salaryFrom Vacancy salary amount from |
262
|
|
|
* |
263
|
|
|
* @return void |
264
|
|
|
*/ |
265
|
|
|
public function setSalaryFrom(?int $salaryFrom): void |
266
|
|
|
{ |
267
|
|
|
$this->salaryFrom = $salaryFrom; |
268
|
|
|
} |
269
|
|
|
|
270
|
|
|
/** |
271
|
|
|
* Returns vacancy salary amount to |
272
|
|
|
* |
273
|
|
|
* @return int|null |
274
|
|
|
*/ |
275
|
|
|
public function getSalaryTo(): ?int |
276
|
|
|
{ |
277
|
|
|
return $this->salaryTo; |
278
|
|
|
} |
279
|
|
|
|
280
|
|
|
/** |
281
|
|
|
* Sets vacancy salary amount to |
282
|
|
|
* |
283
|
|
|
* @param int|null $salaryTo Vacancy salary amount to |
284
|
|
|
* |
285
|
|
|
* @return void |
286
|
|
|
*/ |
287
|
|
|
public function setSalaryTo(?int $salaryTo): void |
288
|
|
|
{ |
289
|
|
|
$this->salaryTo = $salaryTo; |
290
|
|
|
} |
291
|
|
|
|
292
|
|
|
/** |
293
|
|
|
* Returns vacancy salary currency |
294
|
|
|
* |
295
|
|
|
* @return string|null |
296
|
|
|
*/ |
297
|
|
|
public function getSalaryCurrency(): ?string |
298
|
|
|
{ |
299
|
|
|
return $this->salaryCurrency; |
300
|
|
|
} |
301
|
|
|
|
302
|
|
|
/** |
303
|
|
|
* Sets vacancy salary currency |
304
|
|
|
* |
305
|
|
|
* @param string|null $salaryCurrency Vacancy salary currency |
306
|
|
|
* |
307
|
|
|
* @return void |
308
|
|
|
*/ |
309
|
|
|
public function setSalaryCurrency(?string $salaryCurrency): void |
310
|
|
|
{ |
311
|
|
|
$this->salaryCurrency = $salaryCurrency; |
312
|
|
|
} |
313
|
|
|
|
314
|
|
|
/** |
315
|
|
|
* Returns vacancy publication date |
316
|
|
|
* |
317
|
|
|
* @return DateTimeInterface |
318
|
|
|
*/ |
319
|
|
|
public function getPublicationDate(): DateTimeInterface |
320
|
|
|
{ |
321
|
|
|
return $this->publicationDate; |
322
|
|
|
} |
323
|
|
|
|
324
|
|
|
/** |
325
|
|
|
* Sets vacancy publication date |
326
|
|
|
* |
327
|
|
|
* @param DateTimeInterface $publicationDate Vacancy publication date |
328
|
|
|
* |
329
|
|
|
* @return void |
330
|
|
|
*/ |
331
|
|
|
public function setPublicationDate(DateTimeInterface $publicationDate): void |
332
|
|
|
{ |
333
|
|
|
$this->publicationDate = $publicationDate; |
334
|
|
|
} |
335
|
|
|
} |
336
|
|
|
|