|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
declare(strict_types=1); |
|
4
|
|
|
|
|
5
|
|
|
/* |
|
6
|
|
|
* This file is part of the Superdesk Web Publisher Core Bundle. |
|
7
|
|
|
* |
|
8
|
|
|
* Copyright 2020 Sourcefabric z.ú. and contributors. |
|
9
|
|
|
* |
|
10
|
|
|
* For the full copyright and license information, please see the |
|
11
|
|
|
* AUTHORS and LICENSE files distributed with this source code. |
|
12
|
|
|
* |
|
13
|
|
|
* @copyright 2020 Sourcefabric z.ú |
|
14
|
|
|
* @license http://www.superdesk.org/license |
|
15
|
|
|
*/ |
|
16
|
|
|
|
|
17
|
|
|
namespace SWP\Bundle\CoreBundle\AppleNews\Document; |
|
18
|
|
|
|
|
19
|
|
|
use DateTimeInterface; |
|
20
|
|
|
|
|
21
|
|
|
/** |
|
22
|
|
|
* See https://developer.apple.com/documentation/apple_news/metadata. |
|
23
|
|
|
*/ |
|
24
|
|
|
class Metadata |
|
25
|
|
|
{ |
|
26
|
|
|
/** @var string[] */ |
|
27
|
|
|
private $authors = []; |
|
28
|
|
|
|
|
29
|
|
|
/** @var string */ |
|
30
|
|
|
private $canonicalUrl; |
|
31
|
|
|
|
|
32
|
|
|
/** @var DateTimeInterface */ |
|
33
|
|
|
private $dateCreated; |
|
34
|
|
|
|
|
35
|
|
|
/** @var DateTimeInterface|null */ |
|
36
|
|
|
private $dateModified; |
|
37
|
|
|
|
|
38
|
|
|
/** @var DateTimeInterface */ |
|
39
|
|
|
private $datePublished; |
|
40
|
|
|
|
|
41
|
|
|
/** @var string */ |
|
42
|
|
|
private $excerpt; |
|
43
|
|
|
|
|
44
|
|
|
/** @var string */ |
|
45
|
|
|
private $generatorIdentifier; |
|
46
|
|
|
|
|
47
|
|
|
/** @var string */ |
|
48
|
|
|
private $generatorName; |
|
49
|
|
|
|
|
50
|
|
|
/** @var string */ |
|
51
|
|
|
private $generatorVersion; |
|
52
|
|
|
|
|
53
|
|
|
/** @var string[] */ |
|
54
|
|
|
private $keywords = []; |
|
55
|
|
|
|
|
56
|
|
|
/** @var LinkedArticle[] */ |
|
57
|
|
|
private $links = []; |
|
58
|
|
|
|
|
59
|
|
|
/** @var string */ |
|
60
|
|
|
private $thumbnailURL; |
|
61
|
|
|
|
|
62
|
|
|
/** @var bool */ |
|
63
|
|
|
private $transparentToolbar = false; |
|
64
|
|
|
|
|
65
|
|
|
public function getAuthors(): array |
|
66
|
|
|
{ |
|
67
|
|
|
return $this->authors; |
|
68
|
|
|
} |
|
69
|
|
|
|
|
70
|
|
|
public function setAuthors(array $authors): void |
|
71
|
|
|
{ |
|
72
|
|
|
$this->authors = $authors; |
|
73
|
|
|
} |
|
74
|
|
|
|
|
75
|
|
|
public function getCanonicalUrl(): string |
|
76
|
|
|
{ |
|
77
|
|
|
return $this->canonicalUrl; |
|
78
|
|
|
} |
|
79
|
|
|
|
|
80
|
|
|
public function setCanonicalUrl(string $canonicalUrl): void |
|
81
|
|
|
{ |
|
82
|
|
|
$this->canonicalUrl = $canonicalUrl; |
|
83
|
|
|
} |
|
84
|
|
|
|
|
85
|
|
|
public function getDateCreated(): DateTimeInterface |
|
86
|
|
|
{ |
|
87
|
|
|
return $this->dateCreated; |
|
88
|
|
|
} |
|
89
|
|
|
|
|
90
|
|
|
public function setDateCreated(DateTimeInterface $dateCreated): void |
|
91
|
|
|
{ |
|
92
|
|
|
$this->dateCreated = $dateCreated; |
|
93
|
|
|
} |
|
94
|
|
|
|
|
95
|
|
|
public function getDateModified(): ?DateTimeInterface |
|
96
|
|
|
{ |
|
97
|
|
|
return $this->dateModified; |
|
98
|
|
|
} |
|
99
|
|
|
|
|
100
|
|
|
public function setDateModified(?DateTimeInterface $dateModified): void |
|
101
|
|
|
{ |
|
102
|
|
|
$this->dateModified = $dateModified; |
|
103
|
|
|
} |
|
104
|
|
|
|
|
105
|
|
|
public function getDatePublished(): DateTimeInterface |
|
106
|
|
|
{ |
|
107
|
|
|
return $this->datePublished; |
|
108
|
|
|
} |
|
109
|
|
|
|
|
110
|
|
|
public function setDatePublished(DateTimeInterface $datePublished): void |
|
111
|
|
|
{ |
|
112
|
|
|
$this->datePublished = $datePublished; |
|
113
|
|
|
} |
|
114
|
|
|
|
|
115
|
|
|
public function getExcerpt(): string |
|
116
|
|
|
{ |
|
117
|
|
|
return $this->excerpt; |
|
118
|
|
|
} |
|
119
|
|
|
|
|
120
|
|
|
public function setExcerpt(string $excerpt): void |
|
121
|
|
|
{ |
|
122
|
|
|
$this->excerpt = $excerpt; |
|
123
|
|
|
} |
|
124
|
|
|
|
|
125
|
|
|
public function getGeneratorIdentifier(): string |
|
126
|
|
|
{ |
|
127
|
|
|
return $this->generatorIdentifier; |
|
128
|
|
|
} |
|
129
|
|
|
|
|
130
|
|
|
public function setGeneratorIdentifier(string $generatorIdentifier): void |
|
131
|
|
|
{ |
|
132
|
|
|
$this->generatorIdentifier = $generatorIdentifier; |
|
133
|
|
|
} |
|
134
|
|
|
|
|
135
|
|
|
public function getGeneratorName(): string |
|
136
|
|
|
{ |
|
137
|
|
|
return $this->generatorName; |
|
138
|
|
|
} |
|
139
|
|
|
|
|
140
|
|
|
public function setGeneratorName(string $generatorName): void |
|
141
|
|
|
{ |
|
142
|
|
|
$this->generatorName = $generatorName; |
|
143
|
|
|
} |
|
144
|
|
|
|
|
145
|
|
|
public function getGeneratorVersion(): string |
|
146
|
|
|
{ |
|
147
|
|
|
return $this->generatorVersion; |
|
148
|
|
|
} |
|
149
|
|
|
|
|
150
|
|
|
public function setGeneratorVersion(string $generatorVersion): void |
|
151
|
|
|
{ |
|
152
|
|
|
$this->generatorVersion = $generatorVersion; |
|
153
|
|
|
} |
|
154
|
|
|
|
|
155
|
|
|
public function getKeywords(): array |
|
156
|
|
|
{ |
|
157
|
|
|
return $this->keywords; |
|
158
|
|
|
} |
|
159
|
|
|
|
|
160
|
|
|
public function setKeywords(array $keywords): void |
|
161
|
|
|
{ |
|
162
|
|
|
$this->keywords = $keywords; |
|
163
|
|
|
} |
|
164
|
|
|
|
|
165
|
|
|
public function getThumbnailURL(): string |
|
166
|
|
|
{ |
|
167
|
|
|
return $this->thumbnailURL; |
|
168
|
|
|
} |
|
169
|
|
|
|
|
170
|
|
|
public function setThumbnailURL(string $thumbnailURL): void |
|
171
|
|
|
{ |
|
172
|
|
|
$this->thumbnailURL = $thumbnailURL; |
|
173
|
|
|
} |
|
174
|
|
|
|
|
175
|
|
|
public function isTransparentToolbar(): bool |
|
176
|
|
|
{ |
|
177
|
|
|
return $this->transparentToolbar; |
|
178
|
|
|
} |
|
179
|
|
|
|
|
180
|
|
|
public function setTransparentToolbar(bool $transparentToolbar): void |
|
181
|
|
|
{ |
|
182
|
|
|
$this->transparentToolbar = $transparentToolbar; |
|
183
|
|
|
} |
|
184
|
|
|
|
|
185
|
|
|
public function getLinks(): array |
|
186
|
|
|
{ |
|
187
|
|
|
return $this->links; |
|
188
|
|
|
} |
|
189
|
|
|
|
|
190
|
|
|
public function setLinks(array $links): void |
|
191
|
|
|
{ |
|
192
|
|
|
$this->links = $links; |
|
193
|
|
|
} |
|
194
|
|
|
} |
|
195
|
|
|
|