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
|
|
|
* @return mixed |
106
|
|
|
*/ |
107
|
4 |
|
public function getId() |
108
|
|
|
{ |
109
|
4 |
|
return $this->id; |
110
|
|
|
} |
111
|
|
|
|
112
|
|
|
/** |
113
|
|
|
* {@inheritdoc} |
114
|
|
|
*/ |
115
|
|
|
public function setId($id) |
116
|
|
|
{ |
117
|
|
|
$this->id = $id; |
118
|
|
|
} |
119
|
|
|
|
120
|
|
|
/** |
121
|
|
|
* {@inheritdoc} |
122
|
|
|
*/ |
123
|
14 |
|
public function getByline() |
124
|
|
|
{ |
125
|
14 |
|
return $this->byline; |
126
|
|
|
} |
127
|
|
|
|
128
|
|
|
/** |
129
|
|
|
* {@inheritdoc} |
130
|
|
|
*/ |
131
|
|
|
public function setByline($byline) |
132
|
|
|
{ |
133
|
|
|
$this->byline = $byline; |
134
|
|
|
} |
135
|
|
|
|
136
|
|
|
/** |
137
|
|
|
* {@inheritdoc} |
138
|
|
|
*/ |
139
|
13 |
|
public function getSlugline() |
140
|
|
|
{ |
141
|
13 |
|
return $this->slugline; |
142
|
|
|
} |
143
|
|
|
|
144
|
|
|
/** |
145
|
|
|
* {@inheritdoc} |
146
|
|
|
*/ |
147
|
|
|
public function setSlugline($slugline) |
148
|
|
|
{ |
149
|
|
|
$this->slugline = $slugline; |
150
|
|
|
} |
151
|
|
|
|
152
|
|
|
/** |
153
|
|
|
* {@inheritdoc} |
154
|
|
|
*/ |
155
|
13 |
|
public function getLanguage() |
156
|
|
|
{ |
157
|
13 |
|
return $this->language; |
158
|
|
|
} |
159
|
|
|
|
160
|
|
|
/** |
161
|
|
|
* {@inheritdoc} |
162
|
|
|
*/ |
163
|
|
|
public function setLanguage($language) |
164
|
|
|
{ |
165
|
|
|
$this->language = $language; |
166
|
|
|
} |
167
|
|
|
|
168
|
|
|
/** |
169
|
|
|
* {@inheritdoc} |
170
|
|
|
*/ |
171
|
13 |
|
public function getSubjects() |
172
|
|
|
{ |
173
|
13 |
|
return $this->subjects; |
174
|
|
|
} |
175
|
|
|
|
176
|
|
|
/** |
177
|
|
|
* {@inheritdoc} |
178
|
|
|
*/ |
179
|
|
|
public function setSubjects(array $subjects = []) |
180
|
|
|
{ |
181
|
|
|
$this->subjects = $subjects; |
182
|
|
|
} |
183
|
|
|
|
184
|
|
|
/** |
185
|
|
|
* {@inheritdoc} |
186
|
|
|
*/ |
187
|
14 |
|
public function getType() |
188
|
|
|
{ |
189
|
14 |
|
return $this->type; |
190
|
|
|
} |
191
|
|
|
|
192
|
|
|
/** |
193
|
|
|
* {@inheritdoc} |
194
|
|
|
*/ |
195
|
|
|
public function setType($type) |
196
|
|
|
{ |
197
|
|
|
$this->type = $type; |
198
|
|
|
} |
199
|
|
|
|
200
|
|
|
/** |
201
|
|
|
* {@inheritdoc} |
202
|
|
|
*/ |
203
|
13 |
|
public function getPlaces() |
204
|
|
|
{ |
205
|
13 |
|
return $this->places; |
206
|
|
|
} |
207
|
|
|
|
208
|
|
|
/** |
209
|
|
|
* {@inheritdoc} |
210
|
|
|
*/ |
211
|
|
|
public function setPlaces($places) |
212
|
|
|
{ |
213
|
|
|
$this->places = $places; |
214
|
|
|
} |
215
|
|
|
|
216
|
|
|
/** |
217
|
|
|
* {@inheritdoc} |
218
|
|
|
*/ |
219
|
14 |
|
public function getLocated() |
220
|
|
|
{ |
221
|
14 |
|
return $this->located; |
222
|
|
|
} |
223
|
|
|
|
224
|
|
|
/** |
225
|
|
|
* {@inheritdoc} |
226
|
|
|
*/ |
227
|
|
|
public function setLocated($located) |
228
|
|
|
{ |
229
|
|
|
$this->located = $located; |
230
|
|
|
} |
231
|
|
|
|
232
|
|
|
/** |
233
|
|
|
* {@inheritdoc} |
234
|
|
|
*/ |
235
|
13 |
|
public function getUrgency() |
236
|
|
|
{ |
237
|
13 |
|
return $this->urgency; |
238
|
|
|
} |
239
|
|
|
|
240
|
|
|
/** |
241
|
|
|
* {@inheritdoc} |
242
|
|
|
*/ |
243
|
|
|
public function setUrgency($urgency) |
244
|
|
|
{ |
245
|
|
|
$this->urgency = $urgency; |
246
|
|
|
} |
247
|
|
|
|
248
|
|
|
/** |
249
|
|
|
* {@inheritdoc} |
250
|
|
|
*/ |
251
|
13 |
|
public function getPriority() |
252
|
|
|
{ |
253
|
13 |
|
return $this->priority; |
254
|
|
|
} |
255
|
|
|
|
256
|
|
|
/** |
257
|
|
|
* {@inheritdoc} |
258
|
|
|
*/ |
259
|
|
|
public function setPriority($priority) |
260
|
|
|
{ |
261
|
|
|
$this->priority = $priority; |
262
|
|
|
} |
263
|
|
|
|
264
|
|
|
/** |
265
|
|
|
* {@inheritdoc} |
266
|
|
|
*/ |
267
|
|
|
public function getVersion() |
268
|
|
|
{ |
269
|
|
|
return $this->version; |
270
|
|
|
} |
271
|
|
|
|
272
|
|
|
/** |
273
|
|
|
* {@inheritdoc} |
274
|
|
|
*/ |
275
|
|
|
public function setVersion($version) |
276
|
|
|
{ |
277
|
|
|
$this->version = $version; |
278
|
|
|
} |
279
|
|
|
|
280
|
|
|
/** |
281
|
|
|
* {@inheritdoc} |
282
|
|
|
*/ |
283
|
13 |
|
public function getHeadline() |
284
|
|
|
{ |
285
|
13 |
|
return $this->headline; |
286
|
|
|
} |
287
|
|
|
|
288
|
|
|
/** |
289
|
|
|
* {@inheritdoc} |
290
|
|
|
*/ |
291
|
|
|
public function setHeadline($headline) |
292
|
|
|
{ |
293
|
|
|
$this->headline = $headline; |
294
|
|
|
} |
295
|
|
|
|
296
|
|
|
/** |
297
|
|
|
* {@inheritdoc} |
298
|
|
|
*/ |
299
|
13 |
|
public function getGuid() |
300
|
|
|
{ |
301
|
13 |
|
return $this->guid; |
302
|
|
|
} |
303
|
|
|
|
304
|
|
|
/** |
305
|
|
|
* {@inheritdoc} |
306
|
|
|
*/ |
307
|
|
|
public function setGuid($guid) |
308
|
|
|
{ |
309
|
|
|
$this->guid = $guid; |
310
|
|
|
} |
311
|
|
|
|
312
|
|
|
/** |
313
|
|
|
* {@inheritdoc} |
314
|
|
|
*/ |
315
|
13 |
|
public function getServices() |
316
|
|
|
{ |
317
|
13 |
|
return $this->services; |
318
|
|
|
} |
319
|
|
|
|
320
|
|
|
/** |
321
|
|
|
* {@inheritdoc} |
322
|
|
|
*/ |
323
|
|
|
public function setServices(array $services = []) |
324
|
|
|
{ |
325
|
|
|
$this->services = $services; |
326
|
|
|
} |
327
|
|
|
|
328
|
|
|
/** |
329
|
|
|
* {@inheritdoc} |
330
|
|
|
*/ |
331
|
13 |
|
public function getEdNote() |
332
|
|
|
{ |
333
|
13 |
|
return $this->edNote; |
334
|
|
|
} |
335
|
|
|
|
336
|
|
|
/** |
337
|
|
|
* {@inheritdoc} |
338
|
|
|
*/ |
339
|
|
|
public function setEdNote($edNote) |
340
|
|
|
{ |
341
|
|
|
$this->edNote = $edNote; |
342
|
|
|
} |
343
|
|
|
|
344
|
|
|
/** |
345
|
|
|
* {@inheritdoc} |
346
|
|
|
*/ |
347
|
13 |
|
public function getGenre() |
348
|
|
|
{ |
349
|
13 |
|
return $this->genre; |
350
|
|
|
} |
351
|
|
|
|
352
|
|
|
/** |
353
|
|
|
* {@inheritdoc} |
354
|
|
|
*/ |
355
|
|
|
public function setGenre($genre) |
356
|
|
|
{ |
357
|
|
|
$this->genre = $genre; |
358
|
|
|
} |
359
|
|
|
|
360
|
|
|
/** |
361
|
|
|
* @return string |
362
|
|
|
*/ |
363
|
14 |
|
public function getDescription() |
364
|
|
|
{ |
365
|
14 |
|
return $this->description; |
366
|
|
|
} |
367
|
|
|
|
368
|
|
|
/** |
369
|
|
|
* @param string $description |
370
|
|
|
*/ |
371
|
|
|
public function setDescription($description) |
372
|
|
|
{ |
373
|
|
|
$this->description = $description; |
374
|
|
|
} |
375
|
|
|
|
376
|
|
|
/** |
377
|
|
|
* {@inheritdoc} |
378
|
|
|
*/ |
379
|
13 |
|
public function getMetadata() |
380
|
|
|
{ |
381
|
|
|
return [ |
382
|
13 |
|
'subject' => $this->getSubjects(), |
383
|
13 |
|
'urgency' => $this->getUrgency(), |
384
|
13 |
|
'priority' => $this->getPriority(), |
385
|
13 |
|
'located' => $this->getLocated(), |
386
|
13 |
|
'place' => $this->getPlaces(), |
387
|
13 |
|
'service' => $this->getServices(), |
388
|
13 |
|
'type' => $this->getType(), |
389
|
13 |
|
'byline' => $this->getByline(), |
390
|
13 |
|
'guid' => $this->getGuid(), |
391
|
13 |
|
'edNote' => $this->getEdNote(), |
392
|
13 |
|
'genre' => $this->getGenre(), |
393
|
13 |
|
'language' => $this->getLanguage(), |
394
|
|
|
]; |
395
|
|
|
} |
396
|
|
|
} |
397
|
|
|
|