|
1
|
|
|
<?php |
|
2
|
|
|
/** |
|
3
|
|
|
* @author SignpostMarv |
|
4
|
|
|
*/ |
|
5
|
|
|
declare(strict_types=1); |
|
6
|
|
|
|
|
7
|
|
|
namespace SignpostMarv\DaftObject\SchemaOrg\CreativeWork; |
|
8
|
|
|
|
|
9
|
|
|
use SignpostMarv\DaftObject\SchemaOrg\CreativeWork as Base; |
|
10
|
|
|
use SignpostMarv\DaftObject\SchemaOrg\DaftObjectTraits; |
|
11
|
|
|
use SignpostMarv\DaftObject\SchemaOrg\Event; |
|
12
|
|
|
use SignpostMarv\DaftObject\SchemaOrg\Organization; |
|
13
|
|
|
use SignpostMarv\DaftObject\SchemaOrg\Person; |
|
14
|
|
|
use SignpostMarv\DaftObject\SchemaOrg\TypeUtilities; |
|
15
|
|
|
|
|
16
|
|
|
/** |
|
17
|
|
|
* @property array<int, Organization|Person> $composer |
|
18
|
|
|
* @property array<int, Event> $firstPerformance |
|
19
|
|
|
* @property array<int, MusicComposition> $includedComposition |
|
20
|
|
|
* @property array<int, string> $iswcCode |
|
21
|
|
|
* @property array<int, Person> $lyricist |
|
22
|
|
|
* @property array<int, Base> $lyrics |
|
23
|
|
|
* @property array<int, MusicComposition> $musicArrangement |
|
24
|
|
|
* @property array<int, string> $musicCompositionForm |
|
25
|
|
|
* @property array<int, string> $musicalKey |
|
26
|
|
|
* @property array<int, MusicRecording> $recordedAs |
|
27
|
|
|
*/ |
|
28
|
|
|
class MusicComposition extends Base |
|
29
|
|
|
{ |
|
30
|
|
|
use DaftObjectTraits\Composer; |
|
31
|
|
|
|
|
32
|
|
|
const SCHEMA_ORG_TYPE = 'MusicComposition'; |
|
33
|
|
|
|
|
34
|
|
|
const PROPERTIES = [ |
|
35
|
|
|
'composer', |
|
36
|
|
|
'firstPerformance', |
|
37
|
|
|
'includedComposition', |
|
38
|
|
|
'iswcCode', |
|
39
|
|
|
'lyricist', |
|
40
|
|
|
'lyrics', |
|
41
|
|
|
'musicArrangement', |
|
42
|
|
|
'musicCompositionForm', |
|
43
|
|
|
'musicalKey', |
|
44
|
|
|
'recordedAs', |
|
45
|
|
|
]; |
|
46
|
|
|
|
|
47
|
|
|
const PROPERTIES_WITH_MULTI_TYPED_ARRAYS = [ |
|
48
|
|
|
'composer' => [ |
|
49
|
|
|
Organization::class, |
|
50
|
|
|
Person::class, |
|
51
|
|
|
], |
|
52
|
|
|
'firstPerformance' => [ |
|
53
|
|
|
Event::class, |
|
54
|
|
|
], |
|
55
|
|
|
'includedComposition' => [ |
|
56
|
|
|
MusicComposition::class, |
|
57
|
|
|
], |
|
58
|
|
|
'iswcCode' => [ |
|
59
|
|
|
'string', |
|
60
|
|
|
], |
|
61
|
|
|
'lyricist' => [ |
|
62
|
|
|
Person::class, |
|
63
|
|
|
], |
|
64
|
|
|
'lyrics' => [ |
|
65
|
|
|
Base::class, |
|
66
|
|
|
], |
|
67
|
|
|
'musicArrangement' => [ |
|
68
|
|
|
MusicComposition::class, |
|
69
|
|
|
], |
|
70
|
|
|
'musicCompositionForm' => [ |
|
71
|
|
|
'string', |
|
72
|
|
|
], |
|
73
|
|
|
'musicalKey' => [ |
|
74
|
|
|
'string', |
|
75
|
|
|
], |
|
76
|
|
|
'recordedAs' => [ |
|
77
|
|
|
MusicRecording::class, |
|
78
|
|
|
], |
|
79
|
|
|
]; |
|
80
|
|
|
|
|
81
|
|
|
/** |
|
82
|
|
|
* @return array<int, Event> |
|
83
|
|
|
*/ |
|
84
|
5 |
|
public function GetFirstPerformance() : array |
|
85
|
|
|
{ |
|
86
|
|
|
/** |
|
87
|
|
|
* @var array<int, Event> |
|
88
|
|
|
*/ |
|
89
|
5 |
|
$out = TypeUtilities::ExpectRetrievedValueIsArray( |
|
90
|
5 |
|
'firstPerformance', |
|
91
|
5 |
|
$this->RetrievePropertyValueFromData('firstPerformance'), |
|
92
|
5 |
|
static::class |
|
93
|
|
|
); |
|
94
|
|
|
|
|
95
|
5 |
|
return $out; |
|
96
|
|
|
} |
|
97
|
|
|
|
|
98
|
|
|
/** |
|
99
|
|
|
* @param array<int, Event> $value |
|
100
|
|
|
*/ |
|
101
|
1 |
|
public function SetFirstPerformance(array $value) : void |
|
102
|
|
|
{ |
|
103
|
1 |
|
$this->NudgePropertyValue( |
|
104
|
1 |
|
'firstPerformance', |
|
105
|
1 |
|
$value |
|
106
|
|
|
); |
|
107
|
1 |
|
} |
|
108
|
|
|
|
|
109
|
|
|
/** |
|
110
|
|
|
* @return array<int, MusicComposition> |
|
111
|
|
|
*/ |
|
112
|
5 |
|
public function GetIncludedComposition() : array |
|
113
|
|
|
{ |
|
114
|
|
|
/** |
|
115
|
|
|
* @var array<int, MusicComposition> |
|
116
|
|
|
*/ |
|
117
|
5 |
|
$out = TypeUtilities::ExpectRetrievedValueIsArray( |
|
118
|
5 |
|
'includedComposition', |
|
119
|
5 |
|
$this->RetrievePropertyValueFromData('includedComposition'), |
|
120
|
5 |
|
static::class |
|
121
|
|
|
); |
|
122
|
|
|
|
|
123
|
5 |
|
return $out; |
|
124
|
|
|
} |
|
125
|
|
|
|
|
126
|
|
|
/** |
|
127
|
|
|
* @param array<int, MusicComposition> $value |
|
128
|
|
|
*/ |
|
129
|
1 |
|
public function SetIncludedComposition(array $value) : void |
|
130
|
|
|
{ |
|
131
|
1 |
|
$this->NudgePropertyValue( |
|
132
|
1 |
|
'includedComposition', |
|
133
|
1 |
|
$value |
|
134
|
|
|
); |
|
135
|
1 |
|
} |
|
136
|
|
|
|
|
137
|
|
|
/** |
|
138
|
|
|
* @return array<int, string> |
|
139
|
|
|
*/ |
|
140
|
5 |
|
public function GetIswcCode() : array |
|
141
|
|
|
{ |
|
142
|
|
|
/** |
|
143
|
|
|
* @var array<int, string> |
|
144
|
|
|
*/ |
|
145
|
5 |
|
$out = TypeUtilities::ExpectRetrievedValueIsArray( |
|
146
|
5 |
|
'iswcCode', |
|
147
|
5 |
|
$this->RetrievePropertyValueFromData('iswcCode'), |
|
148
|
5 |
|
static::class |
|
149
|
|
|
); |
|
150
|
|
|
|
|
151
|
5 |
|
return $out; |
|
152
|
|
|
} |
|
153
|
|
|
|
|
154
|
|
|
/** |
|
155
|
|
|
* @param array<int, string> $value |
|
156
|
|
|
*/ |
|
157
|
1 |
|
public function SetIswcCode(array $value) : void |
|
158
|
|
|
{ |
|
159
|
1 |
|
$this->NudgePropertyValue( |
|
160
|
1 |
|
'iswcCode', |
|
161
|
1 |
|
$value, |
|
162
|
1 |
|
true |
|
163
|
|
|
); |
|
164
|
1 |
|
} |
|
165
|
|
|
|
|
166
|
|
|
/** |
|
167
|
|
|
* @return array<int, Person> |
|
168
|
|
|
*/ |
|
169
|
5 |
|
public function GetLyricist() : array |
|
170
|
|
|
{ |
|
171
|
|
|
/** |
|
172
|
|
|
* @var array<int, Person> |
|
173
|
|
|
*/ |
|
174
|
5 |
|
$out = TypeUtilities::ExpectRetrievedValueIsArray( |
|
175
|
5 |
|
'lyricist', |
|
176
|
5 |
|
$this->RetrievePropertyValueFromData('lyricist'), |
|
177
|
5 |
|
static::class |
|
178
|
|
|
); |
|
179
|
|
|
|
|
180
|
5 |
|
return $out; |
|
181
|
|
|
} |
|
182
|
|
|
|
|
183
|
|
|
/** |
|
184
|
|
|
* @param array<int, Person> $value |
|
185
|
|
|
*/ |
|
186
|
1 |
|
public function SetLyricist(array $value) : void |
|
187
|
|
|
{ |
|
188
|
1 |
|
$this->NudgePropertyValue( |
|
189
|
1 |
|
'lyricist', |
|
190
|
1 |
|
$value |
|
191
|
|
|
); |
|
192
|
1 |
|
} |
|
193
|
|
|
|
|
194
|
|
|
/** |
|
195
|
|
|
* @return array<int, Base> |
|
196
|
|
|
*/ |
|
197
|
5 |
|
public function GetLyrics() : array |
|
198
|
|
|
{ |
|
199
|
|
|
/** |
|
200
|
|
|
* @var array<int, Base> |
|
201
|
|
|
*/ |
|
202
|
5 |
|
$out = TypeUtilities::ExpectRetrievedValueIsArray( |
|
203
|
5 |
|
'lyrics', |
|
204
|
5 |
|
$this->RetrievePropertyValueFromData('lyrics'), |
|
205
|
5 |
|
static::class |
|
206
|
|
|
); |
|
207
|
|
|
|
|
208
|
5 |
|
return $out; |
|
209
|
|
|
} |
|
210
|
|
|
|
|
211
|
|
|
/** |
|
212
|
|
|
* @param array<int, Base> $value |
|
213
|
|
|
*/ |
|
214
|
1 |
|
public function SetLyrics(array $value) : void |
|
215
|
|
|
{ |
|
216
|
1 |
|
$this->NudgePropertyValue( |
|
217
|
1 |
|
'lyrics', |
|
218
|
1 |
|
$value |
|
219
|
|
|
); |
|
220
|
1 |
|
} |
|
221
|
|
|
|
|
222
|
|
|
/** |
|
223
|
|
|
* @return array<int, MusicComposition> |
|
224
|
|
|
*/ |
|
225
|
5 |
|
public function GetMusicArrangement() : array |
|
226
|
|
|
{ |
|
227
|
|
|
/** |
|
228
|
|
|
* @var array<int, MusicComposition> |
|
229
|
|
|
*/ |
|
230
|
5 |
|
$out = TypeUtilities::ExpectRetrievedValueIsArray( |
|
231
|
5 |
|
'musicArrangement', |
|
232
|
5 |
|
$this->RetrievePropertyValueFromData('musicArrangement'), |
|
233
|
5 |
|
static::class |
|
234
|
|
|
); |
|
235
|
|
|
|
|
236
|
5 |
|
return $out; |
|
237
|
|
|
} |
|
238
|
|
|
|
|
239
|
|
|
/** |
|
240
|
|
|
* @param array<int, MusicComposition> $value |
|
241
|
|
|
*/ |
|
242
|
1 |
|
public function SetMusicArrangement(array $value) : void |
|
243
|
|
|
{ |
|
244
|
1 |
|
$this->NudgePropertyValue( |
|
245
|
1 |
|
'musicArrangement', |
|
246
|
1 |
|
$value |
|
247
|
|
|
); |
|
248
|
1 |
|
} |
|
249
|
|
|
|
|
250
|
|
|
/** |
|
251
|
|
|
* @return array<int, string> |
|
252
|
|
|
*/ |
|
253
|
5 |
|
public function GetMusicCompositionForm() : array |
|
254
|
|
|
{ |
|
255
|
|
|
/** |
|
256
|
|
|
* @var array<int, string> |
|
257
|
|
|
*/ |
|
258
|
5 |
|
$out = TypeUtilities::ExpectRetrievedValueIsArray( |
|
259
|
5 |
|
'musicCompositionForm', |
|
260
|
5 |
|
$this->RetrievePropertyValueFromData('musicCompositionForm'), |
|
261
|
5 |
|
static::class |
|
262
|
|
|
); |
|
263
|
|
|
|
|
264
|
5 |
|
return $out; |
|
265
|
|
|
} |
|
266
|
|
|
|
|
267
|
|
|
/** |
|
268
|
|
|
* @param array<int, string> $value |
|
269
|
|
|
*/ |
|
270
|
1 |
|
public function SetMusicCompositionForm(array $value) : void |
|
271
|
|
|
{ |
|
272
|
1 |
|
$this->NudgePropertyValue( |
|
273
|
1 |
|
'musicCompositionForm', |
|
274
|
1 |
|
$value, |
|
275
|
1 |
|
true |
|
276
|
|
|
); |
|
277
|
1 |
|
} |
|
278
|
|
|
|
|
279
|
|
|
/** |
|
280
|
|
|
* @return array<int, string> |
|
281
|
|
|
*/ |
|
282
|
5 |
|
public function GetMusicalKey() : array |
|
283
|
|
|
{ |
|
284
|
|
|
/** |
|
285
|
|
|
* @var array<int, string> |
|
286
|
|
|
*/ |
|
287
|
5 |
|
$out = TypeUtilities::ExpectRetrievedValueIsArray( |
|
288
|
5 |
|
'musicalKey', |
|
289
|
5 |
|
$this->RetrievePropertyValueFromData('musicalKey'), |
|
290
|
5 |
|
static::class |
|
291
|
|
|
); |
|
292
|
|
|
|
|
293
|
5 |
|
return $out; |
|
294
|
|
|
} |
|
295
|
|
|
|
|
296
|
|
|
/** |
|
297
|
|
|
* @param array<int, string> $value |
|
298
|
|
|
*/ |
|
299
|
1 |
|
public function SetMusicalKey(array $value) : void |
|
300
|
|
|
{ |
|
301
|
1 |
|
$this->NudgePropertyValue( |
|
302
|
1 |
|
'musicalKey', |
|
303
|
1 |
|
$value, |
|
304
|
1 |
|
true |
|
305
|
|
|
); |
|
306
|
1 |
|
} |
|
307
|
|
|
|
|
308
|
|
|
/** |
|
309
|
|
|
* @return array<int, MusicRecording> |
|
310
|
|
|
*/ |
|
311
|
5 |
|
public function GetRecordedAs() : array |
|
312
|
|
|
{ |
|
313
|
|
|
/** |
|
314
|
|
|
* @var array<int, MusicRecording> |
|
315
|
|
|
*/ |
|
316
|
5 |
|
$out = TypeUtilities::ExpectRetrievedValueIsArray( |
|
317
|
5 |
|
'recordedAs', |
|
318
|
5 |
|
$this->RetrievePropertyValueFromData('recordedAs'), |
|
319
|
5 |
|
static::class |
|
320
|
|
|
); |
|
321
|
|
|
|
|
322
|
5 |
|
return $out; |
|
323
|
|
|
} |
|
324
|
|
|
|
|
325
|
|
|
/** |
|
326
|
|
|
* @param array<int, MusicRecording> $value |
|
327
|
|
|
*/ |
|
328
|
1 |
|
public function SetRecordedAs(array $value) : void |
|
329
|
|
|
{ |
|
330
|
1 |
|
$this->NudgePropertyValue( |
|
331
|
1 |
|
'recordedAs', |
|
332
|
1 |
|
$value |
|
333
|
|
|
); |
|
334
|
1 |
|
} |
|
335
|
|
|
} |
|
336
|
|
|
|