Passed
Push — master ( f3e8a6...9053d4 )
by SignpostMarv
03:46
created

MediaObject::GetProductionCompany()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 5
nc 1
nop 0
dl 0
loc 12
ccs 0
cts 6
cp 0
crap 2
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;
8
9
use SignpostMarv\DaftObject\SchemaOrg\CreativeWork\Article\NewsArticle;
10
use SignpostMarv\DaftObject\SchemaOrg\CreativeWork as Base;
11
use SignpostMarv\DaftObject\SchemaOrg\DaftObjectTraits;
12
use SignpostMarv\DaftObject\SchemaOrg\DataTypes\Date;
13
use SignpostMarv\DaftObject\SchemaOrg\Intangible\MediaSubscription;
14
use SignpostMarv\DaftObject\SchemaOrg\Intangible\Quantity\Distance;
15
use SignpostMarv\DaftObject\SchemaOrg\Intangible\Quantity\Duration;
16
use SignpostMarv\DaftObject\SchemaOrg\Intangible\StructuredValue\QuantitativeValue;
17
use SignpostMarv\DaftObject\SchemaOrg\Organization;
18
use SignpostMarv\DaftObject\SchemaOrg\Place;
19
use SignpostMarv\DaftObject\SchemaOrg\TypeUtilities;
20
21
/**
22
* @property array<int, NewsArticle> $associatedArticle
23
* @property array<int, string> $bitrate
24
* @property array<int, string> $contentSize
25
* @property array<int, string> $contentUrl
26
* @property array<int, Duration> $duration
27
* @property array<int, string> $embedUrl
28
* @property array<int, Base> $encodesCreativeWork
29
* @property array<int, string> $encodingFormat
30
* @property array<int, Distance|QuantitativeValue> $height
31
* @property array<int, string> $playerType
32
* @property array<int, Organization> $productionCompany
33
* @property array<int, Place> $regionsAllowed
34
* @property array<int, bool|MediaSubscription> $requiresSubscription
35
* @property array<int, Date> $uploadDate
36
* @property array<int, Distance|QuantitativeValue> $width
37
*/
38
class MediaObject extends Base
39
{
40
    use DaftObjectTraits\Duration;
41
    use DaftObjectTraits\HasHeights;
42
43
    const SCHEMA_ORG_TYPE = 'MediaObject';
44
45
    const PROPERTIES = [
46
        'associatedArticle',
47
        'bitrate',
48
        'contentSize',
49
        'contentUrl',
50
        'duration',
51
        'embedUrl',
52
        'encodesCreativeWork',
53
        'encodingFormat',
54
        'height',
55
        'playerType',
56
        'productionCompany',
57
        'regionsAllowed',
58
        'requiresSubscription',
59
        'uploadDate',
60
        'width',
61
    ];
62
63
    const PROPERTIES_WITH_MULTI_TYPED_ARRAYS = [
64
        'associatedArticle' => [
65
            NewsArticle::class,
66
        ],
67
        'bitrate' => [
68
            'string',
69
        ],
70
        'contentSize' => [
71
            'string',
72
        ],
73
        'contentUrl' => [
74
            'string',
75
        ],
76
        'duration' => TypeUtilities::MULTI_TYPE_DICT__duration,
77
        'embedUrl' => [
78
            'string',
79
        ],
80
        'encodesCreativeWork' => [
81
            Base::class,
82
        ],
83
        'encodingFormat' => [
84
            'string',
85
        ],
86
        'height' => TypeUtilities::MULTI_TYPE_DICT__height,
87
        'playerType' => [
88
            'string',
89
        ],
90
        'productionCompany' => [
91
            Organization::class,
92
        ],
93
        'regionsAllowed' => [
94
            Place::class,
95
        ],
96
        'requiresSubscription' => [
97
            'boolean',
98
            MediaSubscription::class,
99
        ],
100
        'uploadDate' => [
101
            Date::class,
102
        ],
103
        'width' => [
104
            Distance::class,
105
            QuantitativeValue::class,
106
        ],
107
    ];
108
109
    /**
110
    * @return array<int, NewsArticle>
111
    */
112
    public function GetAssociatedArticle() : array
113
    {
114
        /**
115
        * @var array<int, NewsArticle>
116
        */
117
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
118
            'associatedArticle',
119
            $this->RetrievePropertyValueFromData('associatedArticle'),
120
            static::class
121
        );
122
123
        return $out;
124
    }
125
126
    /**
127
    * @param array<int, NewsArticle> $value
128
    */
129
    public function SetAssociatedArticle(array $value) : void
130
    {
131
        $this->NudgePropertyValue(
132
            'associatedArticle',
133
            $value
134
        );
135
    }
136
137
    /**
138
    * @return array<int, string>
139
    */
140
    public function GetBitrate() : array
141
    {
142
        /**
143
        * @var array<int, string>
144
        */
145
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
146
            'bitrate',
147
            $this->RetrievePropertyValueFromData('bitrate'),
148
            static::class
149
        );
150
151
        return $out;
152
    }
153
154
    /**
155
    * @param array<int, string> $value
156
    */
157
    public function SetBitrate(array $value) : void
158
    {
159
        $this->NudgePropertyValue(
160
            'bitrate',
161
            $value,
162
            true
163
        );
164
    }
165
166
    /**
167
    * @return array<int, string>
168
    */
169
    public function GetContentSize() : array
170
    {
171
        /**
172
        * @var array<int, string>
173
        */
174
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
175
            'contentSize',
176
            $this->RetrievePropertyValueFromData('contentSize'),
177
            static::class
178
        );
179
180
        return $out;
181
    }
182
183
    /**
184
    * @param array<int, string> $value
185
    */
186
    public function SetContentSize(array $value) : void
187
    {
188
        $this->NudgePropertyValue(
189
            'contentSize',
190
            $value,
191
            true
192
        );
193
    }
194
195
    /**
196
    * @return array<int, string>
197
    */
198
    public function GetContentUrl() : array
199
    {
200
        /**
201
        * @var array<int, string>
202
        */
203
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
204
            'contentUrl',
205
            $this->RetrievePropertyValueFromData('contentUrl'),
206
            static::class
207
        );
208
209
        return $out;
210
    }
211
212
    /**
213
    * @param array<int, string> $value
214
    */
215
    public function SetContentUrl(array $value) : void
216
    {
217
        $this->NudgePropertyValue(
218
            'contentUrl',
219
            $value,
220
            true
221
        );
222
    }
223
224
    /**
225
    * @return array<int, string>
226
    */
227
    public function GetEmbedUrl() : array
228
    {
229
        /**
230
        * @var array<int, string>
231
        */
232
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
233
            'embedUrl',
234
            $this->RetrievePropertyValueFromData('embedUrl'),
235
            static::class
236
        );
237
238
        return $out;
239
    }
240
241
    /**
242
    * @param array<int, string> $value
243
    */
244
    public function SetEmbedUrl(array $value) : void
245
    {
246
        $this->NudgePropertyValue(
247
            'embedUrl',
248
            $value,
249
            true
250
        );
251
    }
252
253
    /**
254
    * @return array<int, Base>
255
    */
256
    public function GetEncodesCreativeWork() : array
257
    {
258
        /**
259
        * @var array<int, Base>
260
        */
261
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
262
            'encodesCreativeWork',
263
            $this->RetrievePropertyValueFromData('encodesCreativeWork'),
264
            static::class
265
        );
266
267
        return $out;
268
    }
269
270
    /**
271
    * @param array<int, Base> $value
272
    */
273
    public function SetEncodesCreativeWork(array $value) : void
274
    {
275
        $this->NudgePropertyValue(
276
            'encodesCreativeWork',
277
            $value
278
        );
279
    }
280
281
    /**
282
    * @return array<int, string>
283
    */
284
    public function GetEncodingFormat() : array
285
    {
286
        /**
287
        * @var array<int, string>
288
        */
289
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
290
            'encodingFormat',
291
            $this->RetrievePropertyValueFromData('encodingFormat'),
292
            static::class
293
        );
294
295
        return $out;
296
    }
297
298
    /**
299
    * @param array<int, string> $value
300
    */
301
    public function SetEncodingFormat(array $value) : void
302
    {
303
        $this->NudgePropertyValue(
304
            'encodingFormat',
305
            $value,
306
            true
307
        );
308
    }
309
310
    /**
311
    * @return array<int, string>
312
    */
313
    public function GetPlayerType() : array
314
    {
315
        /**
316
        * @var array<int, string>
317
        */
318
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
319
            'playerType',
320
            $this->RetrievePropertyValueFromData('playerType'),
321
            static::class
322
        );
323
324
        return $out;
325
    }
326
327
    /**
328
    * @param array<int, string> $value
329
    */
330
    public function SetPlayerType(array $value) : void
331
    {
332
        $this->NudgePropertyValue(
333
            'playerType',
334
            $value,
335
            true
336
        );
337
    }
338
339
    /**
340
    * @return array<int, Organization>
341
    */
342
    public function GetProductionCompany() : array
343
    {
344
        /**
345
        * @var array<int, Organization>
346
        */
347
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
348
            'productionCompany',
349
            $this->RetrievePropertyValueFromData('productionCompany'),
350
            static::class
351
        );
352
353
        return $out;
354
    }
355
356
    /**
357
    * @param array<int, Organization> $value
358
    */
359
    public function SetProductionCompany(array $value) : void
360
    {
361
        $this->NudgePropertyValue(
362
            'productionCompany',
363
            $value
364
        );
365
    }
366
367
    /**
368
    * @return array<int, Place>
369
    */
370
    public function GetRegionsAllowed() : array
371
    {
372
        /**
373
        * @var array<int, Place>
374
        */
375
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
376
            'regionsAllowed',
377
            $this->RetrievePropertyValueFromData('regionsAllowed'),
378
            static::class
379
        );
380
381
        return $out;
382
    }
383
384
    /**
385
    * @param array<int, Place> $value
386
    */
387
    public function SetRegionsAllowed(array $value) : void
388
    {
389
        $this->NudgePropertyValue(
390
            'regionsAllowed',
391
            $value
392
        );
393
    }
394
395
    /**
396
    * @return array<int, bool|MediaSubscription>
397
    */
398
    public function GetRequiresSubscription() : array
399
    {
400
        /**
401
        * @var array<int, bool|MediaSubscription>
402
        */
403
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
404
            'requiresSubscription',
405
            $this->RetrievePropertyValueFromData('requiresSubscription'),
406
            static::class
407
        );
408
409
        return $out;
410
    }
411
412
    /**
413
    * @param array<int, bool|MediaSubscription> $value
414
    */
415
    public function SetRequiresSubscription(array $value) : void
416
    {
417
        $this->NudgePropertyValue(
418
            'requiresSubscription',
419
            $value
420
        );
421
    }
422
423
    /**
424
    * @return array<int, Date>
425
    */
426
    public function GetUploadDate() : array
427
    {
428
        /**
429
        * @var array<int, Date>
430
        */
431
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
432
            'uploadDate',
433
            $this->RetrievePropertyValueFromData('uploadDate'),
434
            static::class
435
        );
436
437
        return $out;
438
    }
439
440
    /**
441
    * @param array<int, Date> $value
442
    */
443
    public function SetUploadDate(array $value) : void
444
    {
445
        $this->NudgePropertyValue(
446
            'uploadDate',
447
            $value
448
        );
449
    }
450
451
    /**
452
    * @return array<int, Distance|QuantitativeValue>
453
    */
454
    public function GetWidth() : array
455
    {
456
        /**
457
        * @var array<int, Distance|QuantitativeValue>
458
        */
459
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
460
            'width',
461
            $this->RetrievePropertyValueFromData('width'),
462
            static::class
463
        );
464
465
        return $out;
466
    }
467
468
    /**
469
    * @param array<int, Distance|QuantitativeValue> $value
470
    */
471
    public function SetWidth(array $value) : void
472
    {
473
        $this->NudgePropertyValue(
474
            'width',
475
            $value
476
        );
477
    }
478
}
479