1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/* |
4
|
|
|
* This file is part of the Superdesk Web Publisher Bridge Component. |
5
|
|
|
* |
6
|
|
|
* Copyright 2016 Sourcefabric z.ú. and contributors. |
7
|
|
|
* |
8
|
|
|
* For the full copyright and license information, please see the |
9
|
|
|
* AUTHORS and LICENSE files distributed with this source code. |
10
|
|
|
* |
11
|
|
|
* @copyright 2016 Sourcefabric z.ú |
12
|
|
|
* @license http://www.superdesk.org/license |
13
|
|
|
*/ |
14
|
|
|
|
15
|
|
|
namespace SWP\Component\Bridge\Model; |
16
|
|
|
|
17
|
|
|
class BaseContent implements ContentInterface |
18
|
|
|
{ |
19
|
|
|
/** |
20
|
|
|
* @var mixed |
21
|
|
|
*/ |
22
|
|
|
protected $id; |
23
|
|
|
|
24
|
|
|
/** |
25
|
|
|
* @var string |
26
|
|
|
*/ |
27
|
|
|
protected $guid; |
28
|
|
|
|
29
|
|
|
/** |
30
|
|
|
* @var string |
31
|
|
|
*/ |
32
|
|
|
protected $headline; |
33
|
|
|
|
34
|
|
|
/** |
35
|
|
|
* @var string |
36
|
|
|
*/ |
37
|
|
|
protected $byline; |
38
|
|
|
|
39
|
|
|
/** |
40
|
|
|
* @var string |
41
|
|
|
*/ |
42
|
|
|
protected $slugline; |
43
|
|
|
|
44
|
|
|
/** |
45
|
|
|
* @var string |
46
|
|
|
*/ |
47
|
|
|
protected $language; |
48
|
|
|
|
49
|
|
|
/** |
50
|
|
|
* @var array |
51
|
|
|
*/ |
52
|
|
|
protected $subjects = []; |
53
|
|
|
|
54
|
|
|
/** |
55
|
|
|
* @var string |
56
|
|
|
*/ |
57
|
|
|
protected $type; |
58
|
|
|
|
59
|
|
|
/** |
60
|
|
|
* @var array |
61
|
|
|
*/ |
62
|
|
|
protected $places = []; |
63
|
|
|
|
64
|
|
|
/** |
65
|
|
|
* @var array |
66
|
|
|
*/ |
67
|
|
|
protected $services = []; |
68
|
|
|
|
69
|
|
|
/** |
70
|
|
|
* @var string |
71
|
|
|
*/ |
72
|
|
|
protected $located; |
73
|
|
|
|
74
|
|
|
/** |
75
|
|
|
* @var int |
76
|
|
|
*/ |
77
|
|
|
protected $urgency; |
78
|
|
|
|
79
|
|
|
/** |
80
|
|
|
* @var int |
81
|
|
|
*/ |
82
|
|
|
protected $priority; |
83
|
|
|
|
84
|
|
|
/** |
85
|
|
|
* @var int |
86
|
|
|
*/ |
87
|
|
|
protected $version; |
88
|
|
|
|
89
|
|
|
/** |
90
|
|
|
* @var string |
91
|
|
|
*/ |
92
|
|
|
protected $genre; |
93
|
|
|
|
94
|
|
|
/** |
95
|
|
|
* @var string |
96
|
|
|
*/ |
97
|
|
|
protected $edNote; |
98
|
|
|
|
99
|
|
|
/** |
100
|
|
|
* @var string |
101
|
|
|
*/ |
102
|
|
|
protected $description; |
103
|
|
|
|
104
|
|
|
/** |
105
|
|
|
* @var array |
106
|
|
|
*/ |
107
|
|
|
protected $keywords = []; |
108
|
|
|
|
109
|
|
|
/** |
110
|
|
|
* @var string |
111
|
|
|
*/ |
112
|
|
|
protected $pubStatus = ContentInterface::STATUS_USABLE; |
113
|
|
|
|
114
|
|
|
/** |
115
|
|
|
* @return mixed |
116
|
|
|
*/ |
117
|
|
|
public function getId() |
118
|
|
|
{ |
119
|
|
|
return $this->id; |
120
|
|
|
} |
121
|
|
|
|
122
|
|
|
/** |
123
|
|
|
* {@inheritdoc} |
124
|
|
|
*/ |
125
|
|
|
public function setId($id) |
126
|
|
|
{ |
127
|
|
|
$this->id = $id; |
128
|
11 |
|
} |
129
|
|
|
|
130
|
11 |
|
/** |
131
|
|
|
* {@inheritdoc} |
132
|
|
|
*/ |
133
|
|
|
public function getByline() |
134
|
|
|
{ |
135
|
|
|
return $this->byline; |
136
|
|
|
} |
137
|
|
|
|
138
|
|
|
/** |
139
|
|
|
* {@inheritdoc} |
140
|
|
|
*/ |
141
|
|
|
public function setByline($byline) |
142
|
|
|
{ |
143
|
|
|
$this->byline = $byline; |
144
|
11 |
|
} |
145
|
|
|
|
146
|
11 |
|
/** |
147
|
|
|
* {@inheritdoc} |
148
|
|
|
*/ |
149
|
|
|
public function getSlugline() |
150
|
|
|
{ |
151
|
|
|
return $this->slugline; |
152
|
|
|
} |
153
|
|
|
|
154
|
|
|
/** |
155
|
|
|
* {@inheritdoc} |
156
|
|
|
*/ |
157
|
|
|
public function setSlugline($slugline) |
158
|
|
|
{ |
159
|
|
|
$this->slugline = $slugline; |
160
|
11 |
|
} |
161
|
|
|
|
162
|
11 |
|
/** |
163
|
|
|
* {@inheritdoc} |
164
|
|
|
*/ |
165
|
|
|
public function getLanguage() |
166
|
|
|
{ |
167
|
|
|
return $this->language; |
168
|
|
|
} |
169
|
|
|
|
170
|
|
|
/** |
171
|
|
|
* {@inheritdoc} |
172
|
|
|
*/ |
173
|
|
|
public function setLanguage($language) |
174
|
|
|
{ |
175
|
|
|
$this->language = $language; |
176
|
11 |
|
} |
177
|
|
|
|
178
|
11 |
|
/** |
179
|
|
|
* {@inheritdoc} |
180
|
|
|
*/ |
181
|
|
|
public function getSubjects() |
182
|
|
|
{ |
183
|
|
|
return $this->subjects; |
184
|
|
|
} |
185
|
|
|
|
186
|
|
|
/** |
187
|
|
|
* {@inheritdoc} |
188
|
|
|
*/ |
189
|
|
|
public function setSubjects(array $subjects = []) |
190
|
|
|
{ |
191
|
|
|
$this->subjects = $subjects; |
192
|
11 |
|
} |
193
|
|
|
|
194
|
11 |
|
/** |
195
|
|
|
* {@inheritdoc} |
196
|
|
|
*/ |
197
|
|
|
public function getType() |
198
|
|
|
{ |
199
|
|
|
return $this->type; |
200
|
|
|
} |
201
|
|
|
|
202
|
|
|
/** |
203
|
|
|
* {@inheritdoc} |
204
|
|
|
*/ |
205
|
|
|
public function setType($type) |
206
|
|
|
{ |
207
|
|
|
$this->type = $type; |
208
|
11 |
|
} |
209
|
|
|
|
210
|
11 |
|
/** |
211
|
|
|
* {@inheritdoc} |
212
|
|
|
*/ |
213
|
|
|
public function getPlaces() |
214
|
|
|
{ |
215
|
|
|
return $this->places; |
216
|
|
|
} |
217
|
|
|
|
218
|
|
|
/** |
219
|
|
|
* {@inheritdoc} |
220
|
|
|
*/ |
221
|
|
|
public function setPlaces($places) |
222
|
|
|
{ |
223
|
|
|
$this->places = $places; |
224
|
11 |
|
} |
225
|
|
|
|
226
|
11 |
|
/** |
227
|
|
|
* {@inheritdoc} |
228
|
|
|
*/ |
229
|
|
|
public function getLocated() |
230
|
|
|
{ |
231
|
|
|
return $this->located; |
232
|
|
|
} |
233
|
|
|
|
234
|
|
|
/** |
235
|
|
|
* {@inheritdoc} |
236
|
|
|
*/ |
237
|
|
|
public function setLocated($located) |
238
|
|
|
{ |
239
|
|
|
$this->located = $located; |
240
|
11 |
|
} |
241
|
|
|
|
242
|
11 |
|
/** |
243
|
|
|
* {@inheritdoc} |
244
|
|
|
*/ |
245
|
|
|
public function getUrgency() |
246
|
|
|
{ |
247
|
|
|
return $this->urgency; |
248
|
|
|
} |
249
|
|
|
|
250
|
|
|
/** |
251
|
|
|
* {@inheritdoc} |
252
|
|
|
*/ |
253
|
|
|
public function setUrgency($urgency) |
254
|
|
|
{ |
255
|
|
|
$this->urgency = $urgency; |
256
|
11 |
|
} |
257
|
|
|
|
258
|
11 |
|
/** |
259
|
|
|
* {@inheritdoc} |
260
|
|
|
*/ |
261
|
|
|
public function getPriority() |
262
|
|
|
{ |
263
|
|
|
return $this->priority; |
264
|
|
|
} |
265
|
|
|
|
266
|
|
|
/** |
267
|
|
|
* {@inheritdoc} |
268
|
|
|
*/ |
269
|
|
|
public function setPriority($priority) |
270
|
|
|
{ |
271
|
|
|
$this->priority = $priority; |
272
|
|
|
} |
273
|
|
|
|
274
|
|
|
/** |
275
|
|
|
* {@inheritdoc} |
276
|
|
|
*/ |
277
|
|
|
public function getVersion() |
278
|
|
|
{ |
279
|
|
|
return $this->version; |
280
|
|
|
} |
281
|
|
|
|
282
|
|
|
/** |
283
|
|
|
* {@inheritdoc} |
284
|
|
|
*/ |
285
|
|
|
public function setVersion($version) |
286
|
|
|
{ |
287
|
|
|
$this->version = $version; |
288
|
11 |
|
} |
289
|
|
|
|
290
|
11 |
|
/** |
291
|
|
|
* {@inheritdoc} |
292
|
|
|
*/ |
293
|
|
|
public function getHeadline() |
294
|
|
|
{ |
295
|
|
|
return $this->headline; |
296
|
|
|
} |
297
|
|
|
|
298
|
|
|
/** |
299
|
|
|
* {@inheritdoc} |
300
|
|
|
*/ |
301
|
|
|
public function setHeadline($headline) |
302
|
|
|
{ |
303
|
|
|
$this->headline = $headline; |
304
|
11 |
|
} |
305
|
|
|
|
306
|
11 |
|
/** |
307
|
|
|
* {@inheritdoc} |
308
|
|
|
*/ |
309
|
|
|
public function getGuid() |
310
|
|
|
{ |
311
|
|
|
return $this->guid; |
312
|
|
|
} |
313
|
|
|
|
314
|
|
|
/** |
315
|
|
|
* {@inheritdoc} |
316
|
|
|
*/ |
317
|
|
|
public function setGuid($guid) |
318
|
|
|
{ |
319
|
|
|
$this->guid = $guid; |
320
|
11 |
|
} |
321
|
|
|
|
322
|
11 |
|
/** |
323
|
|
|
* {@inheritdoc} |
324
|
|
|
*/ |
325
|
|
|
public function getServices() |
326
|
|
|
{ |
327
|
|
|
return $this->services; |
328
|
|
|
} |
329
|
|
|
|
330
|
|
|
/** |
331
|
|
|
* {@inheritdoc} |
332
|
|
|
*/ |
333
|
|
|
public function setServices(array $services = []) |
334
|
|
|
{ |
335
|
|
|
$this->services = $services; |
336
|
11 |
|
} |
337
|
|
|
|
338
|
11 |
|
/** |
339
|
|
|
* {@inheritdoc} |
340
|
|
|
*/ |
341
|
|
|
public function getEdNote() |
342
|
|
|
{ |
343
|
|
|
return $this->edNote; |
344
|
|
|
} |
345
|
|
|
|
346
|
|
|
/** |
347
|
|
|
* {@inheritdoc} |
348
|
|
|
*/ |
349
|
|
|
public function setEdNote($edNote) |
350
|
|
|
{ |
351
|
|
|
$this->edNote = $edNote; |
352
|
11 |
|
} |
353
|
|
|
|
354
|
11 |
|
/** |
355
|
|
|
* {@inheritdoc} |
356
|
|
|
*/ |
357
|
|
|
public function getGenre() |
358
|
|
|
{ |
359
|
|
|
return $this->genre; |
360
|
|
|
} |
361
|
|
|
|
362
|
|
|
/** |
363
|
|
|
* {@inheritdoc} |
364
|
|
|
*/ |
365
|
|
|
public function setGenre($genre) |
366
|
|
|
{ |
367
|
|
|
$this->genre = $genre; |
368
|
11 |
|
} |
369
|
|
|
|
370
|
11 |
|
/** |
371
|
|
|
* @return string |
372
|
|
|
*/ |
373
|
|
|
public function getDescription() |
374
|
|
|
{ |
375
|
|
|
return $this->description; |
376
|
|
|
} |
377
|
|
|
|
378
|
|
|
/** |
379
|
|
|
* @param string $description |
380
|
|
|
*/ |
381
|
|
|
public function setDescription($description) |
382
|
|
|
{ |
383
|
|
|
$this->description = $description; |
384
|
11 |
|
} |
385
|
|
|
|
386
|
|
|
/** |
387
|
11 |
|
* {@inheritdoc} |
388
|
11 |
|
*/ |
389
|
11 |
|
public function getMetadata() |
390
|
11 |
|
{ |
391
|
11 |
|
return [ |
392
|
11 |
|
'subject' => $this->getSubjects(), |
393
|
11 |
|
'urgency' => $this->getUrgency(), |
394
|
11 |
|
'priority' => $this->getPriority(), |
395
|
11 |
|
'located' => $this->getLocated(), |
396
|
11 |
|
'place' => $this->getPlaces(), |
397
|
11 |
|
'service' => $this->getServices(), |
398
|
11 |
|
'type' => $this->getType(), |
399
|
|
|
'byline' => $this->getByline(), |
400
|
|
|
'guid' => $this->getGuid(), |
401
|
|
|
'edNote' => $this->getEdNote(), |
402
|
|
|
'genre' => $this->getGenre(), |
403
|
|
|
'language' => $this->getLanguage(), |
404
|
|
|
]; |
405
|
11 |
|
} |
406
|
|
|
|
407
|
11 |
|
/** |
408
|
|
|
* {@inheritdoc} |
409
|
|
|
*/ |
410
|
|
|
public function getKeywords(): array |
411
|
|
|
{ |
412
|
|
|
return $this->keywords; |
413
|
|
|
} |
414
|
|
|
|
415
|
|
|
/** |
416
|
|
|
* {@inheritdoc} |
417
|
|
|
*/ |
418
|
|
|
public function setKeywords(array $keywords) |
419
|
|
|
{ |
420
|
|
|
$this->keywords = $keywords; |
421
|
|
|
} |
422
|
|
|
|
423
|
|
|
/** |
424
|
|
|
* {@inheritdoc} |
425
|
|
|
*/ |
426
|
|
|
public function getPubStatus(): string |
427
|
|
|
{ |
428
|
|
|
return $this->pubStatus; |
429
|
|
|
} |
430
|
|
|
|
431
|
|
|
/** |
432
|
|
|
* {@inheritdoc} |
433
|
|
|
*/ |
434
|
|
|
public function setPubStatus(string $pubStatus) |
435
|
|
|
{ |
436
|
|
|
$this->pubStatus = $pubStatus; |
437
|
|
|
} |
438
|
|
|
} |
439
|
|
|
|