|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
declare(strict_types=1); |
|
4
|
|
|
|
|
5
|
|
|
/* |
|
6
|
|
|
* This file is part of the Superdesk Web Publisher Seo Component. |
|
7
|
|
|
* |
|
8
|
|
|
* Copyright 2019 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 2019 Sourcefabric z.ú |
|
14
|
|
|
* @license http://www.superdesk.org/license |
|
15
|
|
|
*/ |
|
16
|
|
|
|
|
17
|
|
|
namespace SWP\Component\Seo\Model; |
|
18
|
|
|
|
|
19
|
|
|
use SWP\Component\Common\Model\TimestampableTrait; |
|
20
|
|
|
|
|
21
|
|
|
class SeoMetadata implements SeoMetadataInterface |
|
22
|
|
|
{ |
|
23
|
|
|
use TimestampableTrait; |
|
24
|
|
|
|
|
25
|
|
|
/** |
|
26
|
|
|
* @var string |
|
27
|
|
|
*/ |
|
28
|
|
|
protected $id; |
|
29
|
|
|
|
|
30
|
|
|
/** |
|
31
|
|
|
* @var string|null |
|
32
|
|
|
*/ |
|
33
|
|
|
protected $metaTitle; |
|
34
|
|
|
|
|
35
|
|
|
/** |
|
36
|
|
|
* @var string|null |
|
37
|
|
|
*/ |
|
38
|
|
|
protected $metaDescription; |
|
39
|
|
|
|
|
40
|
|
|
/** |
|
41
|
|
|
* @var string|null |
|
42
|
|
|
*/ |
|
43
|
|
|
protected $ogTitle; |
|
44
|
|
|
|
|
45
|
|
|
/** |
|
46
|
|
|
* @var string|null |
|
47
|
|
|
*/ |
|
48
|
|
|
protected $ogDescription; |
|
49
|
|
|
|
|
50
|
|
|
/** |
|
51
|
|
|
* @var string|null |
|
52
|
|
|
*/ |
|
53
|
|
|
protected $twitterTitle; |
|
54
|
|
|
|
|
55
|
|
|
/** |
|
56
|
|
|
* @var string|null |
|
57
|
|
|
*/ |
|
58
|
|
|
protected $twitterDescription; |
|
59
|
|
|
|
|
60
|
|
|
/** |
|
61
|
|
|
* @var SeoImageInterface|null |
|
62
|
|
|
*/ |
|
63
|
|
|
protected $metaMedia; |
|
64
|
|
|
|
|
65
|
|
|
/** |
|
66
|
|
|
* @var SeoImageInterface|null |
|
67
|
|
|
*/ |
|
68
|
|
|
protected $ogMedia; |
|
69
|
|
|
|
|
70
|
|
|
/** |
|
71
|
|
|
* @var SeoImageInterface|null |
|
72
|
|
|
*/ |
|
73
|
|
|
protected $twitterMedia; |
|
74
|
|
|
|
|
75
|
|
|
public function setId(?string $id): void |
|
76
|
|
|
{ |
|
77
|
|
|
$this->id = $id; |
|
78
|
|
|
} |
|
79
|
|
|
|
|
80
|
|
|
public function getId(): string |
|
81
|
|
|
{ |
|
82
|
|
|
return $this->id; |
|
83
|
|
|
} |
|
84
|
|
|
|
|
85
|
|
|
public function getMetaTitle(): ?string |
|
86
|
|
|
{ |
|
87
|
|
|
return $this->metaTitle; |
|
88
|
|
|
} |
|
89
|
|
|
|
|
90
|
|
|
public function setMetaTitle(?string $metaTitle): void |
|
91
|
|
|
{ |
|
92
|
|
|
$this->metaTitle = $metaTitle; |
|
93
|
|
|
} |
|
94
|
|
|
|
|
95
|
|
|
public function getMetaDescription(): ?string |
|
96
|
|
|
{ |
|
97
|
|
|
return $this->metaDescription; |
|
98
|
|
|
} |
|
99
|
|
|
|
|
100
|
|
|
public function setMetaDescription(?string $metaDescription): void |
|
101
|
|
|
{ |
|
102
|
|
|
$this->metaDescription = $metaDescription; |
|
103
|
|
|
} |
|
104
|
|
|
|
|
105
|
|
|
public function getOgTitle(): ?string |
|
106
|
|
|
{ |
|
107
|
|
|
return $this->ogTitle; |
|
108
|
|
|
} |
|
109
|
|
|
|
|
110
|
|
|
public function setOgTitle(?string $ogTitle): void |
|
111
|
|
|
{ |
|
112
|
|
|
$this->ogTitle = $ogTitle; |
|
113
|
|
|
} |
|
114
|
|
|
|
|
115
|
|
|
public function getOgDescription(): ?string |
|
116
|
|
|
{ |
|
117
|
|
|
return $this->ogDescription; |
|
118
|
|
|
} |
|
119
|
|
|
|
|
120
|
|
|
public function setOgDescription(?string $ogDescription): void |
|
121
|
|
|
{ |
|
122
|
|
|
$this->ogDescription = $ogDescription; |
|
123
|
|
|
} |
|
124
|
|
|
|
|
125
|
|
|
public function getTwitterTitle(): ?string |
|
126
|
|
|
{ |
|
127
|
|
|
return $this->twitterTitle; |
|
128
|
|
|
} |
|
129
|
|
|
|
|
130
|
|
|
public function setTwitterTitle(?string $twitterTitle): void |
|
131
|
|
|
{ |
|
132
|
|
|
$this->twitterTitle = $twitterTitle; |
|
133
|
|
|
} |
|
134
|
|
|
|
|
135
|
|
|
public function getTwitterDescription(): ?string |
|
136
|
|
|
{ |
|
137
|
|
|
return $this->twitterDescription; |
|
138
|
|
|
} |
|
139
|
|
|
|
|
140
|
|
|
public function setTwitterDescription(?string $twitterDescription): void |
|
141
|
|
|
{ |
|
142
|
|
|
$this->twitterDescription = $twitterDescription; |
|
143
|
|
|
} |
|
144
|
|
|
|
|
145
|
|
|
public function getMetaMedia(): ?SeoImageInterface |
|
146
|
|
|
{ |
|
147
|
|
|
return $this->metaMedia; |
|
148
|
|
|
} |
|
149
|
|
|
|
|
150
|
|
|
public function setMetaMedia(?SeoImageInterface $metaMedia): void |
|
151
|
|
|
{ |
|
152
|
|
|
$this->metaMedia = $metaMedia; |
|
153
|
|
|
} |
|
154
|
|
|
|
|
155
|
|
|
public function getOgMedia(): ?SeoImageInterface |
|
156
|
|
|
{ |
|
157
|
|
|
return $this->ogMedia; |
|
158
|
|
|
} |
|
159
|
|
|
|
|
160
|
|
|
public function setOgMedia(?SeoImageInterface $ogMedia): void |
|
161
|
|
|
{ |
|
162
|
|
|
$this->ogMedia = $ogMedia; |
|
163
|
|
|
} |
|
164
|
|
|
|
|
165
|
|
|
public function getTwitterMedia(): ?SeoImageInterface |
|
166
|
|
|
{ |
|
167
|
|
|
return $this->twitterMedia; |
|
168
|
|
|
} |
|
169
|
|
|
|
|
170
|
|
|
public function setTwitterMedia(?SeoImageInterface $twitterMedia): void |
|
171
|
|
|
{ |
|
172
|
|
|
$this->twitterMedia = $twitterMedia; |
|
173
|
|
|
} |
|
174
|
|
|
} |
|
175
|
|
|
|