|
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\Intangible\Quantity\Duration; |
|
12
|
|
|
use SignpostMarv\DaftObject\SchemaOrg\Organization\PerformingGroup\MusicGroup; |
|
13
|
|
|
use SignpostMarv\DaftObject\SchemaOrg\TypeUtilities; |
|
14
|
|
|
|
|
15
|
|
|
/** |
|
16
|
|
|
* @property array<int, MusicGroup> $byArtist |
|
17
|
|
|
* @property array<int, Duration> $duration |
|
18
|
|
|
* @property array<int, MusicPlaylist\MusicAlbum> $inAlbum |
|
19
|
|
|
* @property array<int, MusicPlaylist> $inPlaylist |
|
20
|
|
|
* @property array<int, string> $isrcCode |
|
21
|
|
|
* @property array<int, MusicComposition> $recordingOf |
|
22
|
|
|
*/ |
|
23
|
|
|
class MusicRecording extends Base |
|
24
|
|
|
{ |
|
25
|
|
|
use DaftObjectTraits\ByArtist; |
|
26
|
|
|
use DaftObjectTraits\Duration; |
|
27
|
|
|
|
|
28
|
|
|
const SCHEMA_ORG_TYPE = 'MusicRecording'; |
|
29
|
|
|
|
|
30
|
|
|
const PROPERTIES = [ |
|
31
|
|
|
'byArtist', |
|
32
|
|
|
'duration', |
|
33
|
|
|
'inAlbum', |
|
34
|
|
|
'inPlaylist', |
|
35
|
|
|
'isrcCode', |
|
36
|
|
|
'recordingOf', |
|
37
|
|
|
]; |
|
38
|
|
|
|
|
39
|
|
|
const PROPERTIES_WITH_MULTI_TYPED_ARRAYS = [ |
|
40
|
|
|
'byArtist' => [ |
|
41
|
|
|
MusicGroup::class, |
|
42
|
|
|
], |
|
43
|
|
|
'duration' => TypeUtilities::MULTI_TYPE_DICT__duration, |
|
44
|
|
|
'inAlbum' => [ |
|
45
|
|
|
MusicPlaylist\MusicAlbum::class, |
|
46
|
|
|
], |
|
47
|
|
|
'inPlaylist' => [ |
|
48
|
|
|
MusicPlaylist::class, |
|
49
|
|
|
], |
|
50
|
|
|
'isrcCode' => [ |
|
51
|
|
|
'string', |
|
52
|
|
|
], |
|
53
|
|
|
'recordingOf' => [ |
|
54
|
|
|
MusicComposition::class, |
|
55
|
|
|
], |
|
56
|
|
|
]; |
|
57
|
|
|
|
|
58
|
|
|
/** |
|
59
|
|
|
* @return array<int, MusicPlaylist\MusicAlbum> |
|
60
|
11 |
|
*/ |
|
61
|
|
|
public function GetInAlbum() : array |
|
62
|
|
|
{ |
|
63
|
|
|
/** |
|
64
|
|
|
* @var array<int, MusicPlaylist\MusicAlbum> |
|
65
|
11 |
|
*/ |
|
66
|
11 |
|
$out = TypeUtilities::ExpectRetrievedValueIsArray( |
|
67
|
11 |
|
'inAlbum', |
|
68
|
11 |
|
$this->RetrievePropertyValueFromData('inAlbum'), |
|
69
|
|
|
static::class |
|
70
|
|
|
); |
|
71
|
11 |
|
|
|
72
|
|
|
return $out; |
|
73
|
|
|
} |
|
74
|
|
|
|
|
75
|
|
|
/** |
|
76
|
|
|
* @param array<int, MusicPlaylist\MusicAlbum> $value |
|
77
|
1 |
|
*/ |
|
78
|
|
|
public function SetInAlbum(array $value) : void |
|
79
|
1 |
|
{ |
|
80
|
1 |
|
$this->NudgePropertyValue( |
|
81
|
1 |
|
'inAlbum', |
|
82
|
|
|
$value |
|
83
|
1 |
|
); |
|
84
|
|
|
} |
|
85
|
|
|
|
|
86
|
|
|
/** |
|
87
|
|
|
* @return array<int, MusicPlaylist> |
|
88
|
11 |
|
*/ |
|
89
|
|
|
public function GetInPlaylist() : array |
|
90
|
|
|
{ |
|
91
|
|
|
/** |
|
92
|
|
|
* @var array<int, MusicPlaylist> |
|
93
|
11 |
|
*/ |
|
94
|
11 |
|
$out = TypeUtilities::ExpectRetrievedValueIsArray( |
|
95
|
11 |
|
'inPlaylist', |
|
96
|
11 |
|
$this->RetrievePropertyValueFromData('inPlaylist'), |
|
97
|
|
|
static::class |
|
98
|
|
|
); |
|
99
|
11 |
|
|
|
100
|
|
|
return $out; |
|
101
|
|
|
} |
|
102
|
|
|
|
|
103
|
|
|
/** |
|
104
|
|
|
* @param array<int, MusicPlaylist> $value |
|
105
|
1 |
|
*/ |
|
106
|
|
|
public function SetInPlaylist(array $value) : void |
|
107
|
1 |
|
{ |
|
108
|
1 |
|
$this->NudgePropertyValue( |
|
109
|
1 |
|
'inPlaylist', |
|
110
|
|
|
$value |
|
111
|
1 |
|
); |
|
112
|
|
|
} |
|
113
|
|
|
|
|
114
|
|
|
/** |
|
115
|
|
|
* @return array<int, string> |
|
116
|
11 |
|
*/ |
|
117
|
|
|
public function GetIsrcCode() : array |
|
118
|
|
|
{ |
|
119
|
|
|
/** |
|
120
|
|
|
* @var array<int, string> |
|
121
|
11 |
|
*/ |
|
122
|
11 |
|
$out = TypeUtilities::ExpectRetrievedValueIsArray( |
|
123
|
11 |
|
'isrcCode', |
|
124
|
11 |
|
$this->RetrievePropertyValueFromData('isrcCode'), |
|
125
|
|
|
static::class |
|
126
|
|
|
); |
|
127
|
11 |
|
|
|
128
|
|
|
return $out; |
|
129
|
|
|
} |
|
130
|
|
|
|
|
131
|
|
|
/** |
|
132
|
|
|
* @param array<int, string> $value |
|
133
|
1 |
|
*/ |
|
134
|
|
|
public function SetIsrcCode(array $value) : void |
|
135
|
1 |
|
{ |
|
136
|
1 |
|
$this->NudgePropertyValue( |
|
137
|
1 |
|
'isrcCode', |
|
138
|
|
|
$value |
|
139
|
1 |
|
); |
|
140
|
|
|
} |
|
141
|
|
|
|
|
142
|
|
|
/** |
|
143
|
|
|
* @return array<int, MusicComposition> |
|
144
|
11 |
|
*/ |
|
145
|
|
|
public function GetRecordingOf() : array |
|
146
|
|
|
{ |
|
147
|
|
|
/** |
|
148
|
|
|
* @var array<int, MusicComposition> |
|
149
|
11 |
|
*/ |
|
150
|
11 |
|
$out = TypeUtilities::ExpectRetrievedValueIsArray( |
|
151
|
11 |
|
'recordingOf', |
|
152
|
11 |
|
$this->RetrievePropertyValueFromData('recordingOf'), |
|
153
|
|
|
static::class |
|
154
|
|
|
); |
|
155
|
11 |
|
|
|
156
|
|
|
return $out; |
|
157
|
|
|
} |
|
158
|
|
|
|
|
159
|
|
|
/** |
|
160
|
|
|
* @param array<int, MusicComposition> $value |
|
161
|
1 |
|
*/ |
|
162
|
|
|
public function SetRecordingOf(array $value) : void |
|
163
|
1 |
|
{ |
|
164
|
1 |
|
$this->NudgePropertyValue( |
|
165
|
1 |
|
'recordingOf', |
|
166
|
|
|
$value |
|
167
|
1 |
|
); |
|
168
|
|
|
} |
|
169
|
|
|
} |
|
170
|
|
|
|