MusicRelease::SetCatalogNumber()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 1
dl 0
loc 6
ccs 5
cts 5
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
* @author SignpostMarv
4
*/
5
declare(strict_types=1);
6
7
namespace SignpostMarv\DaftObject\SchemaOrg\CreativeWork\MusicPlaylist;
8
9
use SignpostMarv\DaftObject\SchemaOrg\CreativeWork\MusicPlaylist as Base;
10
use SignpostMarv\DaftObject\SchemaOrg\DaftObjectTraits;
11
use SignpostMarv\DaftObject\SchemaOrg\Intangible\Enumeration\MusicReleaseFormatType;
12
use SignpostMarv\DaftObject\SchemaOrg\Intangible\Quantity\Duration;
13
use SignpostMarv\DaftObject\SchemaOrg\Organization;
14
use SignpostMarv\DaftObject\SchemaOrg\Person;
15
use SignpostMarv\DaftObject\SchemaOrg\TypeUtilities;
16
17
/**
18
* @property array<int, string> $catalogNumber
19
* @property array<int, Organization|Person> $creditedTo
20
* @property array<int, Duration> $duration
21
* @property array<int, MusicReleaseFormatType> $musicReleaseFormat
22
* @property array<int, Organization> $recordLabel
23
* @property array<int, MusicAlbum> $releaseOf
24
*/
25
class MusicRelease extends Base
26
{
27
    use DaftObjectTraits\Duration;
28
29
    const SCHEMA_ORG_TYPE = 'MusicRelease';
30
31
    const PROPERTIES = [
32
        'catalogNumber',
33
        'creditedTo',
34
        'duration',
35
        'musicReleaseFormat',
36
        'recordLabel',
37
        'releaseOf',
38
    ];
39
40
    const PROPERTIES_WITH_MULTI_TYPED_ARRAYS = [
41
        'catalogNumber' => [
42
            'string',
43
        ],
44
        'creditedTo' => [
45
            Organization::class,
46
            Person::class,
47
        ],
48
        'duration' => TypeUtilities::MULTI_TYPE_DICT__duration,
49
        'musicReleaseFormat' => [
50
            MusicReleaseFormatType::class,
51
        ],
52
        'recordLabel' => [
53
            Organization::class,
54
        ],
55
        'releaseOf' => [
56
            MusicAlbum::class,
57
        ],
58
    ];
59
60
    /**
61
    * @return array<int, string>
62
    */
63 6
    public function GetCatalogNumber() : array
64
    {
65
        /**
66
        * @var array<int, string>
67
        */
68 6
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
69 6
            'catalogNumber',
70 6
            $this->RetrievePropertyValueFromData('catalogNumber'),
71 6
            static::class
72
        );
73
74 6
        return $out;
75
    }
76
77
    /**
78
    * @param array<int, string> $value
79
    */
80 1
    public function SetCatalogNumber(array $value) : void
81
    {
82 1
        $this->NudgePropertyValue(
83 1
            'catalogNumber',
84 1
            $value,
85 1
            self::BOOL_DEFAULT_AUTOTRIMSTRINGS
86
        );
87 1
    }
88
89
    /**
90
    * @return array<int, Organization|Person>
91
    */
92 6
    public function GetCreditedTo() : array
93
    {
94
        /**
95
        * @var array<int, Person>
96
        */
97 6
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
98 6
            'creditedTo',
99 6
            $this->RetrievePropertyValueFromData('creditedTo'),
100 6
            static::class
101
        );
102
103 6
        return $out;
104
    }
105
106
    /**
107
    * @param array<int, Organization|Person> $value
108
    */
109 1
    public function SetCreditedTo(array $value) : void
110
    {
111 1
        $this->NudgePropertyValue(
112 1
            'creditedTo',
113 1
            $value
114
        );
115 1
    }
116
117
    /**
118
    * @return array<int, MusicReleaseFormatType>
119
    */
120 6
    public function GetMusicReleaseFormat() : array
121
    {
122
        /**
123
        * @var array<int, MusicReleaseFormatType>
124
        */
125 6
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
126 6
            'musicReleaseFormat',
127 6
            $this->RetrievePropertyValueFromData('musicReleaseFormat'),
128 6
            static::class
129
        );
130
131 6
        return $out;
132
    }
133
134
    /**
135
    * @param array<int, MusicReleaseFormatType> $value
136
    */
137 1
    public function SetMusicReleaseFormat(array $value) : void
138
    {
139 1
        $this->NudgePropertyValue(
140 1
            'musicReleaseFormat',
141 1
            $value
142
        );
143 1
    }
144
145
    /**
146
    * @return array<int, Organization>
147
    */
148 6
    public function GetRecordLabel() : array
149
    {
150
        /**
151
        * @var array<int, Organization>
152
        */
153 6
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
154 6
            'recordLabel',
155 6
            $this->RetrievePropertyValueFromData('recordLabel'),
156 6
            static::class
157
        );
158
159 6
        return $out;
160
    }
161
162
    /**
163
    * @param array<int, Organization> $value
164
    */
165 1
    public function SetRecordLabel(array $value) : void
166
    {
167 1
        $this->NudgePropertyValue(
168 1
            'recordLabel',
169 1
            $value
170
        );
171 1
    }
172
173
    /**
174
    * @return array<int, MusicAlbum>
175
    */
176 6
    public function GetReleaseOf() : array
177
    {
178
        /**
179
        * @var array<int, MusicAlbum>
180
        */
181 6
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
182 6
            'releaseOf',
183 6
            $this->RetrievePropertyValueFromData('releaseOf'),
184 6
            static::class
185
        );
186
187 6
        return $out;
188
    }
189
190
    /**
191
    * @param array<int, MusicAlbum> $value
192
    */
193 1
    public function SetReleaseOf(array $value) : void
194
    {
195 1
        $this->NudgePropertyValue(
196 1
            'releaseOf',
197 1
            $value
198
        );
199 1
    }
200
}
201