-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcreativework.php
More file actions
502 lines (424 loc) · 13.1 KB
/
creativework.php
File metadata and controls
502 lines (424 loc) · 13.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
<?php
/**
* @author Chris Zuber <chris@chriszuber.com>
* @package superuserdev/schemaserver
* @copyright 2017
* @license https://opensource.org/licenses/LGPL-3.0 GNU Lesser General Public License version 3
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3.0 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library.
*/
namespace SuperUserDev\SchemaServer;
/**
* @see https://schema.org/CreativeWork
*/
class CreativeWork extends Thing
{
use Traits\DateTime;
/**
* [setAbout description]
* @param Thing $about [description]
*/
final public function setAbout(Thing $about): self
{
return $this->_set('about', $about);
}
final public function setAccessMode(String $access_mode): self
{
return $this->_set('accessMode', $access_mode);
}
final public function setAccessModeSufficient(String $modes): self
{
return $this->_set('accessModeSufficient', $modes);
}
final public function setAccessibilityAPI(String $resource): self
{
return $this->_set('accessibilityAPI', $resource);
}
final public function setAccessibilityControl(String $control): self
{
return $this->_set('accessibilitiyControl', $control);
}
final public function setAccessibilityFeature(String $feature): self
{
return $this->_set('accessibilityFeature', $feature);
}
final public function setAccessibilityHazard(String $hazard): self
{
return $this->_set('accessibilityHazard', $hazard);
}
final public function setAccessibilitySummary(String $summary): self
{
return $this->_set('accessibilitySummary', $summary);
}
final public function setAccountablePerson(Peron $person): self
{
return $this->_set('accountablePerson', $person);
}
final public function setAggregateRating(AggregateRating $rating): self
{
return $this->_set('aggregateRating', $rating);
}
final public function setAlternativeHeadline(String $alt_headline): self
{
return $this->_set('alternativeHeadline', $alt_headline);
}
final public function setAudience(Audience $audience): self
{
return $this->_set('audience', $audience);
}
final public function setAudio(AudioObject $audio): self
{
return $this->_set('audio', $audio);
}
final public function setAuthor(Thing $author): self
{
if ($author instanceof Person or $author instanceof Organization) {
return $this->_set('author', $author);
} else {
throw new \InvalidArgumentException(sprintf(
'Author must be an instance of Person or Organization. Instance of %s given',
$author::getType()
));
}
}
final public function setAward(String $award): self
{
return $this->_set('award', $award);
}
final public function setCharacter(Person $character): self
{
return $this->_set('character', $character);
}
final public function setCitation(CreativeWork $citation): self
{
return $this->_set('citation', $citation);
}
final public function setComment(Comment $comment): self
{
return $this->_set('comment', $comment);
}
final public function setCommentCount(Int $comment_count): self
{
return $this->_set('commentCount', $comment_count);
}
final public function setContentLocation(Place $location): self
{
return $this->_set('contentLocation', $location);
}
final public function setContentRating(String $rating): self
{
return $this->_set('contentRating', $rating);
}
final public function setContributor(Thing $contributor): self
{
if ($contributor instanceof Person or $contributor instanceof Organization) {
return $this->_set('contributor', $contributor);
} else {
throw new \InvalidArgumentException(sprintf(
'Contributor must be an instance of Person or Organization. Instance of %s given',
$contributor::getType()
));
}
}
final public function setCopyRightHolder(Thing $copyright_holder): self
{
if ($copyright_holder instanceof Person or $copyright_holder instanceof Organization) {
return $this->_set('copyrightHolder', $copyright_holder);
} else {
throw new \InvalidArgumentException(sprintf(
'Copyright Holder must be an instance of Person or Organization. Instance of %s given',
$copyright_holder::getType()
));
}
}
final public function setCopyrightYear(Int $year): self
{
return $this->_set('copyrightYear', $year);
}
final public function setCreator(Thing $creator): self
{
if ($creator instanceof Person or $creator instanceof Organization) {
return $this->_set('creator', $creator);
} else {
throw new \InvalidArgumentException(sprintf(
'Creator Holder must be an instance of Person or Organization. Instance of %s given',
$creator::getType()
));
}
}
final public function setDateCreated(String $created, Bool $use_time = true): self
{
return $this->_set('dateCreated', static::formatDate($created, true, $use_time));
}
final public function setDatModified(String $created): self
{
return $this->_set('dateModified', static::formatDate($created, true, false));
}
final public function setDatePublished(String $created, Bool $use_time = true): self
{
return $this->_set('datePublished', static::formatDate($created, true, $use_time));
}
final public function setDiscussionUrl(String $discussion_url): self
{
if (static::_isURL($discussion_url)) {
$this->_se('discussionUrl', $discussionUrl);
} else {
throw new \InvalidArgumentException("{$discussionUrl} is not a valid URL");
}
}
final public function setEditor(Person $editor): self
{
return $this->_set('editor', $editor);
}
final public function setEducationalAlignment(AlignmentObject $alignment): self
{
return $this->_set('educationalAlignment', $alignment);
}
final public function setEducationalUse(String $use): self
{
return $this->_set('educationalUse', $use);
}
final public function setEncoding(MediaObject $media): self
{
return $this->_set('encoding', $media);
}
final public function setExampleOfWork(CreativeWork $example): self
{
return $this->_set('exampleOfWork', $example);
}
final public function setExpires(String $expires): self
{
return $this->_set('expires', static::formatDate($expires, true, false));
}
final public function setFileFormat(String $format): self
{
return $this->_set('fileFormat', $format);
}
final public function setFunder(Thing $funder): self
{
if ($funder instanceof Person or $funder instanceof Organization) {
return $this->_set('funder', $funder);
} else {
throw new \InvalidArgumentException(sprintf(
'Funder must be an instance of Person or Organization. Instance of %s given',
$funder::getType()
));
}
}
final public function setGenre(String $genre): self
{
return $this->_set('genre', $genre);
}
final public function setHasPart(CreativeWork $part): self
{
return $this->_set('hasPart', $part);
}
final public function setHeadline(String $headline): self
{
return $this->_set('headline', $headline);
}
final public function setLanguage(Language $lang): self
{
return $this->_set('language', $lang);
}
// final public function setInteractionStatistic(InteractionCounter $service): self
// {
// return $this->_set('interactionStatistic', $service);
// }
final public function setInteractivityType(String $type): self
{
return $this->_set('interactivityType', $type);
}
final public function setIsAccessibleForFree(Bool $is_free): self
{
return $this->_set('isAccessibleForFree', $is_free);
}
final public function setIsBasedOn(Thing $based_on): self
{
if ($based_on instanceof CreativeWork or $based_on instanceof Product) {
return $this->_set('isBasedOn', $based_on);
} else {
throw new \InvalidArgumentException(sprintf(
'isBasedOn must be an instance of CreativeWork or Product. %s given',
$based_on::getType()
));
}
}
final public function setIsFamilyFriendly(Bool $family_friendly): self
{
return $this->_set('isFamilyFriendly', $family_friendly);
}
final public function setIsPartOf(CreativeWork $work): self
{
return $this->_set('isPartOf', $work);
}
final public function setKeywords(String $keywords): self
{
return $this->_set('keywords', $keywords);
}
final public function setLearningResourceType(String $type): self
{
return $this->_set('learningResourceType', $type);
}
final public function setLicense(CreativeWork $license): self
{
return $this->_set('license', $license);
}
final public function setLocationCreated(Place $location): self
{
return $this->_set('locationCreated', $location);
}
final public function setMainEntity(Thing $entity): self
{
return $this->_set('mainEntity', $entity);
}
final public function setMaterial(Product $material): self
{
return $this->_set('material', $material);
}
final public function setMentions(Thing $mentioned): self
{
return $this->_set('mentions', $mentioned);
}
final public function setOffers(Offer $offered): self
{
return $this->_set('offers', $offered);
}
final public function setPosition(Int $position): self
{
return $this->_set('position', $position);
}
final public function setProducer(Thing $producer): self
{
if ($producer instanceof Person or $producer instanceof Organization) {
return $this->_set('producer', $producer);
} else {
throw new \InvalidArgumentException(sprintf(
'Producer must be an instance of Person or Organization. Instance of %s given',
$producer::getType()
));
}
}
final public function setProvider(Thing $provider): self
{
if ($provider instanceof Person or $provider instanceof Organization) {
return $this->_set('provider', $provider);
} else {
throw new \InvalidArgumentException(sprintf(
'Provider must be an instance of Person or Organization. Instance of %s given',
$provider::getType()
));
}
}
final public function setPublication(PublicationEvent $publication): self
{
return $this->_set('publication', $publication);
}
final public function setPublisher(Thing $publisher): self
{
if ($publisher instanceof Person or $publisher instanceof Organization) {
return $this->_set('publisher', $publisher);
} else {
throw new \InvalidArgumentException(sprintf(
'Publisher must be an instance of Person or Organization. Instance of %s given',
$publisher::getType()
));
}
}
final public function setPublishingPrinciples(CreativeWork $principles): self
{
return $this->_set('publisingPrinciples', $principles);
}
final public function setRecordedAt(Event $event): self
{
return $this->_set('recordedAt', $event);
}
final public function setReleasedEvent(PublicationEvent $released): self
{
$this->_seet('releasedEvent', $released);
}
final public function setReview(Review $review): self
{
return $this->_set('review', $review);
}
final public function setSchemaVersion(String $version): self
{
return $this->_set('schemaVersion', $version);
}
final public function setSourceOrganization(Organization $source): self
{
return $this->_set('sourceOrganization', $source);
}
final public function setSpatialCoverage(Place $covers): self
{
return $this->_set('spatialCoverage', $covers);
}
final public function setSponsor(Thing $sponsor): self
{
if ($sponsor instanceof Person or $sponsor instanceof Organization) {
return $this->_set('sponsor', $sponsor);
} else {
throw new \InvalidArgumentException(sprintf(
'Sponsor must be an instance of Person or Organization. Instance of %s given',
$sponsor::getType()
));
}
}
final public function setTemporalCoverage(String $coverage): self
{
return $this->_set('temporalCoverage', $coverage);
}
final public function setText(String $text): self
{
return $this->_set('text', $text);
}
final public function setThumbnailUrl(String $url): self
{
if (static::_isURL($url)) {
return $this->_set('thumbnailUrl', $url);
} else {
throw new \InvalidArgumentException("{$url} is not a valid URL");
}
}
final public function setTimeRequired(Duration $duration): self
{
return $this->_set('timeRequired', $duration);
}
final public function setTranslator(Thing $translator): self
{
if ($translator instanceof Person or $translator instanceof Organization) {
return $this->_set('translator', $translator);
} else {
throw new \InvalidArgumentException(sprintf(
'Translator must be an instance of Person or Organization. Instance of %s given',
$translator::getType()
));
}
}
final public function setTypicalAgeRange(String $age_range): self
{
return $this->_set('typicalAgeRange', $age_range);
}
final public function setVersion(String $version): self
{
return $this->_set('version', $version);
}
final public function setVideo(VideoObject $video): self
{
return $this->_set('video', $video);
}
final public function setWorkExample(CreativeWork $example): self
{
return $this->_set('workExample', $example);
}
}