1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/** |
4
|
|
|
* (c) Kitodo. Key to digital objects e.V. <[email protected]> |
5
|
|
|
* |
6
|
|
|
* This file is part of the Kitodo and TYPO3 projects. |
7
|
|
|
* |
8
|
|
|
* @license GNU General Public License version 3 or later. |
9
|
|
|
* For the full copyright and license information, please read the |
10
|
|
|
* LICENSE.txt file that was distributed with this source code. |
11
|
|
|
*/ |
12
|
|
|
|
13
|
|
|
namespace Kitodo\Dlf\Domain\Model; |
14
|
|
|
|
15
|
|
|
use TYPO3\CMS\Extbase\Annotation as Extbase; |
16
|
|
|
use TYPO3\CMS\Extbase\Persistence\Generic\LazyLoadingProxy; |
17
|
|
|
use TYPO3\CMS\Extbase\Persistence\ObjectStorage; |
18
|
|
|
|
19
|
|
|
class Metadata extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity |
20
|
|
|
{ |
21
|
|
|
/** |
22
|
|
|
* @var int |
23
|
|
|
*/ |
24
|
|
|
protected $sorting; |
25
|
|
|
|
26
|
|
|
/** |
27
|
|
|
* @var string |
28
|
|
|
*/ |
29
|
|
|
protected $label; |
30
|
|
|
|
31
|
|
|
/** |
32
|
|
|
* @var string |
33
|
|
|
*/ |
34
|
|
|
protected $indexName; |
35
|
|
|
|
36
|
|
|
/** |
37
|
|
|
* @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\Kitodo\Dlf\Domain\Model\MetadataFormat> |
38
|
|
|
* @Extbase\ORM\Lazy |
39
|
|
|
* @Extbase\ORM\Cascade("remove") |
40
|
|
|
*/ |
41
|
|
|
protected $format; |
42
|
|
|
|
43
|
|
|
/** |
44
|
|
|
* @var string |
45
|
|
|
*/ |
46
|
|
|
protected $defaultValue; |
47
|
|
|
|
48
|
|
|
/** |
49
|
|
|
* @var string |
50
|
|
|
*/ |
51
|
|
|
protected $wrap; |
52
|
|
|
|
53
|
|
|
/** |
54
|
|
|
* @var int |
55
|
|
|
*/ |
56
|
|
|
protected $indexTokenized; |
57
|
|
|
|
58
|
|
|
/** |
59
|
|
|
* @var int |
60
|
|
|
*/ |
61
|
|
|
protected $indexStored; |
62
|
|
|
|
63
|
|
|
/** |
64
|
|
|
* @var int |
65
|
|
|
*/ |
66
|
|
|
protected $indexIndexed; |
67
|
|
|
|
68
|
|
|
/** |
69
|
|
|
* @var float |
70
|
|
|
*/ |
71
|
|
|
protected $indexBoost; |
72
|
|
|
|
73
|
|
|
/** |
74
|
|
|
* @var int |
75
|
|
|
*/ |
76
|
|
|
protected $isSortable; |
77
|
|
|
|
78
|
|
|
/** |
79
|
|
|
* @var int |
80
|
|
|
*/ |
81
|
|
|
protected $isFacet; |
82
|
|
|
|
83
|
|
|
/** |
84
|
|
|
* @var int |
85
|
|
|
*/ |
86
|
|
|
protected $isListed; |
87
|
|
|
|
88
|
|
|
/** |
89
|
|
|
* @var int |
90
|
|
|
*/ |
91
|
|
|
protected $indexAutocomplete; |
92
|
|
|
|
93
|
|
|
/** |
94
|
|
|
* @var int |
95
|
|
|
*/ |
96
|
|
|
protected $status; |
97
|
|
|
|
98
|
|
|
/** |
99
|
|
|
* @var int |
100
|
|
|
*/ |
101
|
|
|
protected $sysLanguageUid; |
102
|
|
|
|
103
|
|
|
/** |
104
|
|
|
* constructor |
105
|
|
|
*/ |
106
|
|
|
public function __construct() |
107
|
|
|
{ |
108
|
|
|
// Do not remove the next line: It would break the functionality |
109
|
|
|
$this->initStorageObjects(); |
110
|
|
|
} |
111
|
|
|
|
112
|
|
|
protected function initStorageObjects() |
113
|
|
|
{ |
114
|
|
|
$this->format = new ObjectStorage(); |
115
|
|
|
} |
116
|
|
|
|
117
|
|
|
/** |
118
|
|
|
* @return int |
119
|
|
|
*/ |
120
|
|
|
public function getSorting(): int |
121
|
|
|
{ |
122
|
|
|
return $this->sorting; |
123
|
|
|
} |
124
|
|
|
|
125
|
|
|
/** |
126
|
|
|
* @param int $sorting |
127
|
|
|
*/ |
128
|
|
|
public function setSorting(int $sorting): void |
129
|
|
|
{ |
130
|
|
|
$this->sorting = $sorting; |
131
|
|
|
} |
132
|
|
|
|
133
|
|
|
/** |
134
|
|
|
* @return string |
135
|
|
|
*/ |
136
|
|
|
public function getLabel(): string |
137
|
|
|
{ |
138
|
|
|
return $this->label; |
139
|
|
|
} |
140
|
|
|
|
141
|
|
|
/** |
142
|
|
|
* @param string $label |
143
|
|
|
*/ |
144
|
|
|
public function setLabel(string $label): void |
145
|
|
|
{ |
146
|
|
|
$this->label = $label; |
147
|
|
|
} |
148
|
|
|
|
149
|
|
|
/** |
150
|
|
|
* @return string |
151
|
|
|
*/ |
152
|
|
|
public function getIndexName(): string |
153
|
|
|
{ |
154
|
|
|
return $this->indexName; |
155
|
|
|
} |
156
|
|
|
|
157
|
|
|
/** |
158
|
|
|
* @param string $indexName |
159
|
|
|
*/ |
160
|
|
|
public function setIndexName(string $indexName): void |
161
|
|
|
{ |
162
|
|
|
$this->indexName = $indexName; |
163
|
|
|
} |
164
|
|
|
|
165
|
|
|
/** |
166
|
|
|
* @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\Kitodo\Dlf\Domain\Model\MetadataFormat> $format |
167
|
|
|
*/ |
168
|
|
|
public function getFormat() |
169
|
|
|
{ |
170
|
|
|
return $this->format; |
171
|
|
|
} |
172
|
|
|
|
173
|
|
|
/** |
174
|
|
|
* @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\Kitodo\Dlf\Domain\Model\MetadataFormat> $format |
175
|
|
|
*/ |
176
|
|
|
public function setFormat(ObjectStorage $format): void |
177
|
|
|
{ |
178
|
|
|
$this->format = $format; |
179
|
|
|
} |
180
|
|
|
|
181
|
|
|
/** |
182
|
|
|
* Adds a Format |
183
|
|
|
* |
184
|
|
|
* @param \Kitodo\Dlf\Domain\Model\MetadataFormat $format |
185
|
|
|
* |
186
|
|
|
* @return void |
187
|
|
|
*/ |
188
|
|
|
public function addFormat(MetadataFormat $format) |
189
|
|
|
{ |
190
|
|
|
$this->format->attach($format); |
191
|
|
|
} |
192
|
|
|
|
193
|
|
|
/** |
194
|
|
|
* Removes a Format |
195
|
|
|
* |
196
|
|
|
* @param \Kitodo\Dlf\Domain\Model\MetadataFormat $formatToRemove |
197
|
|
|
* |
198
|
|
|
* @return void |
199
|
|
|
*/ |
200
|
|
|
public function removeFormat(MetadataFormat $formatToRemove) |
201
|
|
|
{ |
202
|
|
|
$this->format->detach($formatToRemove); |
203
|
|
|
} |
204
|
|
|
|
205
|
|
|
/** |
206
|
|
|
* @return string |
207
|
|
|
*/ |
208
|
|
|
public function getDefaultValue(): string |
209
|
|
|
{ |
210
|
|
|
return $this->defaultValue; |
211
|
|
|
} |
212
|
|
|
|
213
|
|
|
/** |
214
|
|
|
* @param string $defaultValue |
215
|
|
|
*/ |
216
|
|
|
public function setDefaultValue(string $defaultValue): void |
217
|
|
|
{ |
218
|
|
|
$this->defaultValue = $defaultValue; |
219
|
|
|
} |
220
|
|
|
|
221
|
|
|
/** |
222
|
|
|
* @return string |
223
|
|
|
*/ |
224
|
|
|
public function getWrap(): string |
225
|
|
|
{ |
226
|
|
|
return $this->wrap; |
227
|
|
|
} |
228
|
|
|
|
229
|
|
|
/** |
230
|
|
|
* @param string $wrap |
231
|
|
|
*/ |
232
|
|
|
public function setWrap(string $wrap): void |
233
|
|
|
{ |
234
|
|
|
$this->wrap = $wrap; |
235
|
|
|
} |
236
|
|
|
|
237
|
|
|
/** |
238
|
|
|
* @return int |
239
|
|
|
*/ |
240
|
|
|
public function getIndexTokenized(): int |
241
|
|
|
{ |
242
|
|
|
return $this->indexTokenized; |
243
|
|
|
} |
244
|
|
|
|
245
|
|
|
/** |
246
|
|
|
* @param int $indexTokenized |
247
|
|
|
*/ |
248
|
|
|
public function setIndexTokenized(int $indexTokenized): void |
249
|
|
|
{ |
250
|
|
|
$this->indexTokenized = $indexTokenized; |
251
|
|
|
} |
252
|
|
|
|
253
|
|
|
/** |
254
|
|
|
* @return int |
255
|
|
|
*/ |
256
|
|
|
public function getIndexStored(): int |
257
|
|
|
{ |
258
|
|
|
return $this->indexStored; |
259
|
|
|
} |
260
|
|
|
|
261
|
|
|
/** |
262
|
|
|
* @param int $indexStored |
263
|
|
|
*/ |
264
|
|
|
public function setIndexStored(int $indexStored): void |
265
|
|
|
{ |
266
|
|
|
$this->indexStored = $indexStored; |
267
|
|
|
} |
268
|
|
|
|
269
|
|
|
/** |
270
|
|
|
* @return int |
271
|
|
|
*/ |
272
|
|
|
public function getIndexIndexed(): int |
273
|
|
|
{ |
274
|
|
|
return $this->indexIndexed; |
275
|
|
|
} |
276
|
|
|
|
277
|
|
|
/** |
278
|
|
|
* @param int $indexIndexed |
279
|
|
|
*/ |
280
|
|
|
public function setIndexIndexed(int $indexIndexed): void |
281
|
|
|
{ |
282
|
|
|
$this->indexIndexed = $indexIndexed; |
283
|
|
|
} |
284
|
|
|
|
285
|
|
|
/** |
286
|
|
|
* @return float |
287
|
|
|
*/ |
288
|
|
|
public function getIndexBoost(): float |
289
|
|
|
{ |
290
|
|
|
return $this->indexBoost; |
291
|
|
|
} |
292
|
|
|
|
293
|
|
|
/** |
294
|
|
|
* @param float $indexBoost |
295
|
|
|
*/ |
296
|
|
|
public function setIndexBoost(float $indexBoost): void |
297
|
|
|
{ |
298
|
|
|
$this->indexBoost = $indexBoost; |
299
|
|
|
} |
300
|
|
|
|
301
|
|
|
/** |
302
|
|
|
* @return int |
303
|
|
|
*/ |
304
|
|
|
public function getIsSortable(): int |
305
|
|
|
{ |
306
|
|
|
return $this->isSortable; |
307
|
|
|
} |
308
|
|
|
|
309
|
|
|
/** |
310
|
|
|
* @param int $isSortable |
311
|
|
|
*/ |
312
|
|
|
public function setIsSortable(int $isSortable): void |
313
|
|
|
{ |
314
|
|
|
$this->isSortable = $isSortable; |
315
|
|
|
} |
316
|
|
|
|
317
|
|
|
/** |
318
|
|
|
* @return int |
319
|
|
|
*/ |
320
|
|
|
public function getIsFacet(): int |
321
|
|
|
{ |
322
|
|
|
return $this->isFacet; |
323
|
|
|
} |
324
|
|
|
|
325
|
|
|
/** |
326
|
|
|
* @param int $isFacet |
327
|
|
|
*/ |
328
|
|
|
public function setIsFacet(int $isFacet): void |
329
|
|
|
{ |
330
|
|
|
$this->isFacet = $isFacet; |
331
|
|
|
} |
332
|
|
|
|
333
|
|
|
/** |
334
|
|
|
* @return int |
335
|
|
|
*/ |
336
|
|
|
public function getIsListed(): int |
337
|
|
|
{ |
338
|
|
|
return $this->isListed; |
339
|
|
|
} |
340
|
|
|
|
341
|
|
|
/** |
342
|
|
|
* @param int $isListed |
343
|
|
|
*/ |
344
|
|
|
public function setIsListed(int $isListed): void |
345
|
|
|
{ |
346
|
|
|
$this->isListed = $isListed; |
347
|
|
|
} |
348
|
|
|
|
349
|
|
|
/** |
350
|
|
|
* @return int |
351
|
|
|
*/ |
352
|
|
|
public function getIndexAutocomplete(): int |
353
|
|
|
{ |
354
|
|
|
return $this->indexAutocomplete; |
355
|
|
|
} |
356
|
|
|
|
357
|
|
|
/** |
358
|
|
|
* @param int $indexAutocomplete |
359
|
|
|
*/ |
360
|
|
|
public function setIndexAutocomplete(int $indexAutocomplete): void |
361
|
|
|
{ |
362
|
|
|
$this->indexAutocomplete = $indexAutocomplete; |
363
|
|
|
} |
364
|
|
|
|
365
|
|
|
/** |
366
|
|
|
* @return int |
367
|
|
|
*/ |
368
|
|
|
public function getStatus(): int |
369
|
|
|
{ |
370
|
|
|
return $this->status; |
371
|
|
|
} |
372
|
|
|
|
373
|
|
|
/** |
374
|
|
|
* @param int $status |
375
|
|
|
*/ |
376
|
|
|
public function setStatus(int $status): void |
377
|
|
|
{ |
378
|
|
|
$this->status = $status; |
379
|
|
|
} |
380
|
|
|
|
381
|
|
|
/** |
382
|
|
|
* @return int |
383
|
|
|
*/ |
384
|
|
|
public function getSysLanguageUid(): int |
385
|
|
|
{ |
386
|
|
|
return $this->sysLanguageUid; |
387
|
|
|
} |
388
|
|
|
|
389
|
|
|
/** |
390
|
|
|
* @param int $sysLanguageUid |
391
|
|
|
*/ |
392
|
|
|
public function setSysLanguageUid(int $sysLanguageUid): void |
393
|
|
|
{ |
394
|
|
|
$this->sysLanguageUid = $sysLanguageUid; |
395
|
|
|
} |
396
|
|
|
|
397
|
|
|
} |
398
|
|
|
|