1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare(strict_types=1); |
4
|
|
|
|
5
|
|
|
namespace Application\Traits; |
6
|
|
|
|
7
|
|
|
use Application\Utility; |
8
|
|
|
use Doctrine\ORM\Mapping as ORM; |
9
|
|
|
use Ecodev\Felix\Model\Traits\HasUrl; |
10
|
|
|
|
11
|
|
|
/** |
12
|
|
|
* Trait for "simple" properties of an card. |
13
|
|
|
* |
14
|
|
|
* They are mostly what was called "meta" in the old DILPS. And we split |
15
|
|
|
* them only to reduce the Card class size to focus on most important code. |
16
|
|
|
*/ |
17
|
|
|
trait CardSimpleProperties |
18
|
|
|
{ |
19
|
|
|
use HasUrl; |
20
|
|
|
|
21
|
|
|
#[ORM\Column(type: 'text', options: ['default' => ''])] |
22
|
|
|
private string $addition = ''; |
23
|
|
|
|
24
|
|
|
#[ORM\Column(type: 'text', options: ['default' => ''])] |
25
|
|
|
private string $expandedName = ''; |
26
|
|
|
|
27
|
|
|
#[ORM\Column(type: 'string', options: ['default' => ''])] |
28
|
|
|
private string $material = ''; |
29
|
|
|
|
30
|
|
|
#[ORM\Column(type: 'string', options: ['default' => ''])] |
31
|
|
|
private string $techniqueAuthor = ''; |
32
|
|
|
|
33
|
|
|
#[ORM\Column(type: 'string', length: 60, options: ['default' => ''])] |
34
|
|
|
private string $techniqueDate = ''; |
35
|
|
|
|
36
|
|
|
#[ORM\Column(type: 'string', options: ['default' => ''])] |
37
|
|
|
private string $format = ''; |
38
|
|
|
|
39
|
|
|
#[ORM\Column(type: 'text', options: ['default' => ''])] |
40
|
|
|
private string $literature = ''; |
41
|
|
|
|
42
|
|
|
#[ORM\Column(type: 'text', options: ['default' => ''])] |
43
|
|
|
private string $objectReference = ''; |
44
|
|
|
|
45
|
|
|
#[ORM\Column(type: 'string', length: 10, options: ['default' => ''])] |
46
|
|
|
private string $page = ''; |
47
|
|
|
|
48
|
|
|
#[ORM\Column(type: 'string', length: 10, options: ['default' => ''])] |
49
|
|
|
private string $figure = ''; |
50
|
|
|
|
51
|
|
|
#[ORM\Column(name: '`table`', type: 'string', length: 10, options: ['default' => ''])] |
52
|
|
|
private string $table = ''; |
53
|
|
|
|
54
|
|
|
#[ORM\Column(type: 'string', length: 30, options: ['default' => ''])] |
55
|
|
|
private string $isbn = ''; |
56
|
|
|
|
57
|
|
|
#[ORM\Column(type: 'text', options: ['default' => ''])] |
58
|
|
|
private string $comment = ''; |
59
|
|
|
|
60
|
|
|
#[ORM\Column(type: 'text', options: ['default' => ''])] |
61
|
|
|
private string $corpus = ''; |
62
|
|
|
|
63
|
|
|
#[ORM\Column(type: 'string', options: ['default' => ''])] |
64
|
|
|
private string $rights = ''; |
65
|
|
|
|
66
|
|
|
#[ORM\Column(type: 'string', options: ['default' => ''])] |
67
|
|
|
private string $muserisUrl = ''; |
68
|
|
|
|
69
|
|
|
#[ORM\Column(type: 'string', options: ['default' => ''])] |
70
|
|
|
private string $muserisCote = ''; |
71
|
|
|
|
72
|
|
|
#[ORM\Column(type: 'string', length: 60, options: ['default' => ''])] |
73
|
|
|
private string $productionPlace = ''; |
74
|
|
|
|
75
|
|
|
#[ORM\Column(type: 'text', options: ['default' => ''])] |
76
|
|
|
private string $urlDescription = ''; |
77
|
|
|
|
78
|
|
|
public function getAddition(): string |
79
|
|
|
{ |
80
|
|
|
return $this->addition; |
81
|
3 |
|
} |
82
|
|
|
|
83
|
3 |
|
public function setAddition(string $addition): void |
84
|
|
|
{ |
85
|
|
|
$this->addition = $addition; |
86
|
8 |
|
} |
87
|
|
|
|
88
|
8 |
|
public function getExpandedName(): string |
89
|
|
|
{ |
90
|
|
|
return $this->expandedName; |
91
|
5 |
|
} |
92
|
|
|
|
93
|
5 |
|
public function setExpandedName(string $expandedName): void |
94
|
|
|
{ |
95
|
|
|
$this->expandedName = Utility::sanitizeRichText($expandedName); |
96
|
13 |
|
} |
97
|
|
|
|
98
|
13 |
|
public function getMaterial(): string |
99
|
|
|
{ |
100
|
|
|
return $this->material; |
101
|
4 |
|
} |
102
|
|
|
|
103
|
4 |
|
public function setMaterial(string $material): void |
104
|
|
|
{ |
105
|
|
|
$this->material = $material; |
106
|
8 |
|
} |
107
|
|
|
|
108
|
8 |
|
public function getTechniqueAuthor(): string |
109
|
|
|
{ |
110
|
|
|
return $this->techniqueAuthor; |
111
|
3 |
|
} |
112
|
|
|
|
113
|
3 |
|
public function setTechniqueAuthor(string $techniqueAuthor): void |
114
|
|
|
{ |
115
|
|
|
$this->techniqueAuthor = $techniqueAuthor; |
116
|
8 |
|
} |
117
|
|
|
|
118
|
8 |
|
public function getTechniqueDate(): string |
119
|
|
|
{ |
120
|
|
|
return $this->techniqueDate; |
121
|
3 |
|
} |
122
|
|
|
|
123
|
3 |
|
public function setTechniqueDate(string $techniqueDate): void |
124
|
|
|
{ |
125
|
|
|
$this->techniqueDate = $techniqueDate; |
126
|
9 |
|
} |
127
|
|
|
|
128
|
9 |
|
public function getFormat(): string |
129
|
|
|
{ |
130
|
|
|
return $this->format; |
131
|
3 |
|
} |
132
|
|
|
|
133
|
3 |
|
public function setFormat(string $format): void |
134
|
|
|
{ |
135
|
|
|
$this->format = $format; |
136
|
8 |
|
} |
137
|
|
|
|
138
|
8 |
|
public function getLiterature(): string |
139
|
|
|
{ |
140
|
|
|
return $this->literature; |
141
|
4 |
|
} |
142
|
|
|
|
143
|
4 |
|
public function setLiterature(string $literature): void |
144
|
|
|
{ |
145
|
|
|
$this->literature = Utility::sanitizeRichText($literature); |
146
|
8 |
|
} |
147
|
|
|
|
148
|
8 |
|
public function getObjectReference(): string |
149
|
|
|
{ |
150
|
|
|
return $this->objectReference; |
151
|
3 |
|
} |
152
|
|
|
|
153
|
3 |
|
public function setObjectReference(string $objectReference): void |
154
|
|
|
{ |
155
|
|
|
$this->objectReference = $objectReference; |
156
|
8 |
|
} |
157
|
|
|
|
158
|
8 |
|
public function getPage(): string |
159
|
|
|
{ |
160
|
|
|
return $this->page; |
161
|
3 |
|
} |
162
|
|
|
|
163
|
3 |
|
public function setPage(string $page): void |
164
|
|
|
{ |
165
|
|
|
// Field is readonly and can only be emptied. |
166
|
8 |
|
if ($page !== '') { |
167
|
|
|
return; |
168
|
8 |
|
} |
169
|
|
|
|
170
|
|
|
$this->page = $page; |
171
|
3 |
|
} |
172
|
|
|
|
173
|
3 |
|
public function getFigure(): string |
174
|
|
|
{ |
175
|
|
|
return $this->figure; |
176
|
8 |
|
} |
177
|
|
|
|
178
|
|
|
public function setFigure(string $figure): void |
179
|
8 |
|
{ |
180
|
8 |
|
// Field is readonly and can only be emptied. |
181
|
|
|
if ($figure !== '') { |
182
|
|
|
return; |
183
|
|
|
} |
184
|
|
|
|
185
|
|
|
$this->figure = $figure; |
186
|
3 |
|
} |
187
|
|
|
|
188
|
3 |
|
public function getTable(): string |
189
|
|
|
{ |
190
|
|
|
return $this->table; |
191
|
8 |
|
} |
192
|
|
|
|
193
|
|
|
public function setTable(string $table): void |
194
|
8 |
|
{ |
195
|
8 |
|
// Field is readonly and can only be emptied. |
196
|
|
|
if ($table !== '') { |
197
|
|
|
return; |
198
|
|
|
} |
199
|
|
|
|
200
|
|
|
$this->table = $table; |
201
|
3 |
|
} |
202
|
|
|
|
203
|
3 |
|
public function getIsbn(): string |
204
|
|
|
{ |
205
|
|
|
return $this->isbn; |
206
|
8 |
|
} |
207
|
|
|
|
208
|
|
|
public function setIsbn(string $isbn): void |
209
|
8 |
|
{ |
210
|
8 |
|
$this->isbn = $isbn; |
211
|
|
|
} |
212
|
|
|
|
213
|
|
|
public function getComment(): string |
214
|
|
|
{ |
215
|
|
|
return $this->comment; |
216
|
3 |
|
} |
217
|
|
|
|
218
|
3 |
|
public function setComment(string $comment): void |
219
|
|
|
{ |
220
|
|
|
$this->comment = $comment; |
221
|
|
|
} |
222
|
|
|
|
223
|
|
|
public function getCorpus(): string |
224
|
|
|
{ |
225
|
|
|
return $this->corpus; |
226
|
|
|
} |
227
|
|
|
|
228
|
|
|
public function setCorpus(string $corpus): void |
229
|
|
|
{ |
230
|
|
|
$this->corpus = Utility::sanitizeRichText($corpus); |
231
|
8 |
|
} |
232
|
|
|
|
233
|
8 |
|
public function getRights(): string |
234
|
|
|
{ |
235
|
|
|
return $this->rights; |
236
|
|
|
} |
237
|
|
|
|
238
|
|
|
public function setRights(string $rights): void |
239
|
|
|
{ |
240
|
|
|
$this->rights = $rights; |
241
|
7 |
|
} |
242
|
|
|
|
243
|
7 |
|
public function getMuserisUrl(): string |
244
|
|
|
{ |
245
|
|
|
return $this->muserisUrl; |
246
|
|
|
} |
247
|
|
|
|
248
|
|
|
public function setMuserisUrl(string $muserisUrl): void |
249
|
|
|
{ |
250
|
|
|
$this->muserisUrl = $muserisUrl; |
251
|
8 |
|
} |
252
|
|
|
|
253
|
8 |
|
public function getMuserisCote(): string |
254
|
|
|
{ |
255
|
|
|
return $this->muserisCote; |
256
|
|
|
} |
257
|
|
|
|
258
|
|
|
public function setMuserisCote(string $muserisCote): void |
259
|
|
|
{ |
260
|
|
|
$this->muserisCote = $muserisCote; |
261
|
8 |
|
} |
262
|
|
|
|
263
|
8 |
|
public function getProductionPlace(): string |
264
|
|
|
{ |
265
|
|
|
return $this->productionPlace; |
266
|
|
|
} |
267
|
|
|
|
268
|
|
|
public function setProductionPlace(string $productionPlace): void |
269
|
|
|
{ |
270
|
|
|
$this->productionPlace = $productionPlace; |
271
|
8 |
|
} |
272
|
|
|
|
273
|
8 |
|
public function getUrlDescription(): string |
274
|
|
|
{ |
275
|
|
|
return $this->urlDescription; |
276
|
3 |
|
} |
277
|
|
|
|
278
|
3 |
|
public function setUrlDescription(string $urlDescription): void |
279
|
|
|
{ |
280
|
|
|
$this->urlDescription = Utility::sanitizeRichText($urlDescription); |
281
|
8 |
|
} |
282
|
|
|
} |
283
|
|
|
|