1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace luya\web\jsonld; |
4
|
|
|
|
5
|
|
|
use luya\helpers\ObjectHelper; |
6
|
|
|
|
7
|
|
|
/** |
8
|
|
|
* JsonLd - Event trait |
9
|
|
|
* |
10
|
|
|
* @see http://schema.org/Event |
11
|
|
|
* |
12
|
|
|
* @author Alex Schmid |
13
|
|
|
* @since 1.0.0 |
14
|
|
|
*/ |
15
|
|
|
trait EventTrait |
16
|
|
|
{ |
17
|
|
|
private $_about; |
18
|
|
|
|
19
|
|
|
/** |
20
|
|
|
* @return Thing |
21
|
|
|
*/ |
22
|
|
|
public function getAbout() |
23
|
|
|
{ |
24
|
|
|
return $this->_about; |
25
|
|
|
} |
26
|
|
|
|
27
|
|
|
/** |
28
|
|
|
* The subject matter of the content. |
29
|
|
|
* Inverse property: subjectOf. |
30
|
|
|
* |
31
|
|
|
* @param Thing $about |
32
|
|
|
* @return EventTrait |
|
|
|
|
33
|
|
|
*/ |
34
|
|
|
public function setAbout($about) |
35
|
|
|
{ |
36
|
|
|
$this->_about = $about; |
37
|
|
|
return $this; |
38
|
|
|
} |
39
|
|
|
|
40
|
|
|
private $_actor; |
41
|
|
|
|
42
|
|
|
/** |
43
|
|
|
* @return Person |
44
|
|
|
*/ |
45
|
|
|
public function getActor() |
46
|
|
|
{ |
47
|
|
|
return $this->_actor; |
48
|
|
|
} |
49
|
|
|
|
50
|
|
|
/** |
51
|
|
|
* An actor, e.g. in tv, radio, movie, video games etc., or in an event. |
52
|
|
|
* Actors can be associated with individual items or with a series, episode, clip. Supersedes actors. |
53
|
|
|
* |
54
|
|
|
* @param Person $actor |
55
|
|
|
* @return EventTrait |
|
|
|
|
56
|
|
|
*/ |
57
|
|
|
public function setActor($actor) |
58
|
|
|
{ |
59
|
|
|
$this->_actor = $actor; |
60
|
|
|
return $this; |
61
|
|
|
} |
62
|
|
|
|
63
|
|
|
private $_attendee; |
64
|
|
|
|
65
|
|
|
/** |
66
|
|
|
* @return Organization|Person |
67
|
|
|
*/ |
68
|
|
|
public function getAttendee() |
69
|
|
|
{ |
70
|
|
|
return $this->_attendee; |
71
|
|
|
} |
72
|
|
|
|
73
|
|
|
/** |
74
|
|
|
* A person or organization attending the event. Supersedes attendees. |
75
|
|
|
* |
76
|
|
|
* @param Organization|Person $attendee |
77
|
|
|
* @return EventTrait |
|
|
|
|
78
|
|
|
*/ |
79
|
|
View Code Duplication |
public function setAttendee($attendee) |
|
|
|
|
80
|
|
|
{ |
81
|
|
|
ObjectHelper::isInstanceOf($attendee, [Organization::class, PersonInterface::class]); |
|
|
|
|
82
|
|
|
|
83
|
|
|
$this->_attendee = $attendee; |
84
|
|
|
return $this; |
85
|
|
|
} |
86
|
|
|
|
87
|
|
|
private $_composer; |
88
|
|
|
|
89
|
|
|
/** |
90
|
|
|
* @return Organization|Person |
91
|
|
|
*/ |
92
|
|
|
public function getComposer() |
93
|
|
|
{ |
94
|
|
|
return $this->_composer; |
95
|
|
|
} |
96
|
|
|
|
97
|
|
|
/** |
98
|
|
|
* The person or organization who wrote a composition, or who is the composer of a work performed at some event. |
99
|
|
|
* |
100
|
|
|
* @param Organization|Person $composer |
101
|
|
|
* @return EventTrait |
|
|
|
|
102
|
|
|
*/ |
103
|
|
View Code Duplication |
public function setComposer($composer) |
|
|
|
|
104
|
|
|
{ |
105
|
|
|
ObjectHelper::isInstanceOf($author, [Organization::class, PersonInterface::class]); |
|
|
|
|
106
|
|
|
|
107
|
|
|
$this->_composer = $composer; |
108
|
|
|
return $this; |
109
|
|
|
} |
110
|
|
|
|
111
|
|
|
private $_contributor; |
112
|
|
|
|
113
|
|
|
/** |
114
|
|
|
* @return Organization|Person |
115
|
|
|
*/ |
116
|
|
|
public function getContributor() |
117
|
|
|
{ |
118
|
|
|
return $this->_contributor; |
119
|
|
|
} |
120
|
|
|
|
121
|
|
|
/** |
122
|
|
|
* A secondary contributor to the CreativeWork or Event. |
123
|
|
|
* |
124
|
|
|
* @param Organization|Person $contributor |
125
|
|
|
* @return EventTrait |
|
|
|
|
126
|
|
|
*/ |
127
|
|
View Code Duplication |
public function setContributor($contributor) |
|
|
|
|
128
|
|
|
{ |
129
|
|
|
ObjectHelper::isInstanceOf($contributor, [Organization::class, PersonInterface::class]); |
|
|
|
|
130
|
|
|
|
131
|
|
|
$this->_contributor = $contributor; |
132
|
|
|
return $this; |
133
|
|
|
} |
134
|
|
|
|
135
|
|
|
private $_director; |
136
|
|
|
|
137
|
|
|
/** |
138
|
|
|
* @return Person |
139
|
|
|
*/ |
140
|
|
|
public function getDirector() |
141
|
|
|
{ |
142
|
|
|
return $this->_director; |
143
|
|
|
} |
144
|
|
|
|
145
|
|
|
/** |
146
|
|
|
* A director of e.g. tv, radio, movie, video gaming etc. content, or of an event. |
147
|
|
|
* Directors can be associated with individual items or with a series, episode, clip. |
148
|
|
|
* Supersedes directors. |
149
|
|
|
* |
150
|
|
|
* @param Person $director |
151
|
|
|
* @return EventTrait |
|
|
|
|
152
|
|
|
*/ |
153
|
|
|
public function setDirector($director) |
154
|
|
|
{ |
155
|
|
|
$this->_director = $director; |
156
|
|
|
return $this; |
157
|
|
|
} |
158
|
|
|
|
159
|
|
|
private $_doorTime; |
160
|
|
|
|
161
|
|
|
/** |
162
|
|
|
* @return DateTime |
163
|
|
|
*/ |
164
|
|
|
public function getDoorTime() |
165
|
|
|
{ |
166
|
|
|
return $this->_doorTime; |
167
|
|
|
} |
168
|
|
|
|
169
|
|
|
/** |
170
|
|
|
* The time admission will commence. |
171
|
|
|
* |
172
|
|
|
* @param DateTime $doorTime |
173
|
|
|
* @return EventTrait |
|
|
|
|
174
|
|
|
*/ |
175
|
|
|
public function setDoorTime($doorTime) |
176
|
|
|
{ |
177
|
|
|
$this->_doorTime = $doorTime; |
178
|
|
|
return $this; |
179
|
|
|
} |
180
|
|
|
|
181
|
|
|
private $_duration; |
182
|
|
|
|
183
|
|
|
/** |
184
|
|
|
* @return Duration |
185
|
|
|
*/ |
186
|
|
|
public function getDuration() |
187
|
|
|
{ |
188
|
|
|
return $this->_duration; |
189
|
|
|
} |
190
|
|
|
|
191
|
|
|
/** |
192
|
|
|
* The duration of the item (movie, audio recording, event, etc.) in ISO 8601 date format. |
193
|
|
|
* |
194
|
|
|
* @param Duration $duration |
195
|
|
|
* @return EventTrait |
|
|
|
|
196
|
|
|
*/ |
197
|
|
|
public function setDuration($duration) |
198
|
|
|
{ |
199
|
|
|
$this->_duration = $duration; |
200
|
|
|
return $this; |
201
|
|
|
} |
202
|
|
|
|
203
|
|
|
private $_endDate; |
204
|
|
|
|
205
|
|
|
/** |
206
|
|
|
* @return Date|DateTime |
207
|
|
|
*/ |
208
|
|
|
public function getEndDate() |
209
|
|
|
{ |
210
|
|
|
return $this->_endDate; |
211
|
|
|
} |
212
|
|
|
|
213
|
|
|
/** |
214
|
|
|
* The end date and time of the item (in ISO 8601 date format). |
215
|
|
|
* |
216
|
|
|
* @param Date|DateTime $endDate |
217
|
|
|
* @return EventTrait |
|
|
|
|
218
|
|
|
*/ |
219
|
|
|
public function setEndDate($endDate) |
220
|
|
|
{ |
221
|
|
|
$this->_endDate = $endDate; |
222
|
|
|
return $this; |
223
|
|
|
} |
224
|
|
|
|
225
|
|
|
private $_funder; |
226
|
|
|
|
227
|
|
|
/** |
228
|
|
|
* @return Organization|Person |
229
|
|
|
*/ |
230
|
|
|
public function getFunder() |
231
|
|
|
{ |
232
|
|
|
return $this->_funder; |
233
|
|
|
} |
234
|
|
|
|
235
|
|
|
/** |
236
|
|
|
* A person or organization that supports (sponsors) something through some kind of financial contribution. |
237
|
|
|
* |
238
|
|
|
* @param Organization|Person $funder |
239
|
|
|
* @return EventTrait |
|
|
|
|
240
|
|
|
*/ |
241
|
|
View Code Duplication |
public function setFunder($funder) |
|
|
|
|
242
|
|
|
{ |
243
|
|
|
ObjectHelper::isInstanceOf($funder, [Organization::class, PersonInterface::class]); |
|
|
|
|
244
|
|
|
|
245
|
|
|
$this->_funder = $funder; |
246
|
|
|
return $this; |
247
|
|
|
} |
248
|
|
|
|
249
|
|
|
private $_inLanguage; |
250
|
|
|
|
251
|
|
|
/** |
252
|
|
|
* @return Language|Text |
253
|
|
|
*/ |
254
|
|
|
public function getInLanguage() |
255
|
|
|
{ |
256
|
|
|
return $this->_inLanguage; |
257
|
|
|
} |
258
|
|
|
|
259
|
|
|
/** |
260
|
|
|
* The language of the content or performance or used in an action. |
261
|
|
|
* Please use one of the language codes from the IETF BCP 47 standard. See also availableLanguage. |
262
|
|
|
* Supersedes language. |
263
|
|
|
* |
264
|
|
|
* @param Language|Text $inLanguage |
265
|
|
|
* @return EventTrait |
|
|
|
|
266
|
|
|
*/ |
267
|
|
|
public function setInLanguage($inLanguage) |
268
|
|
|
{ |
269
|
|
|
$this->_inLanguage = $inLanguage; |
270
|
|
|
return $this; |
271
|
|
|
} |
272
|
|
|
|
273
|
|
|
private $_isAccessibleForFree; |
274
|
|
|
|
275
|
|
|
/** |
276
|
|
|
* @return bool |
277
|
|
|
*/ |
278
|
|
|
public function isAccessibleForFree() |
279
|
|
|
{ |
280
|
|
|
return $this->_isAccessibleForFree; |
281
|
|
|
} |
282
|
|
|
|
283
|
|
|
/** |
284
|
|
|
* A flag to signal that the item, event, or place is accessible for free. Supersedes free. |
285
|
|
|
* |
286
|
|
|
* @param bool $isAccessibleForFree |
287
|
|
|
* @return EventTrait |
|
|
|
|
288
|
|
|
*/ |
289
|
|
|
public function setIsAccessibleForFree($isAccessibleForFree) |
290
|
|
|
{ |
291
|
|
|
$this->_isAccessibleForFree = $isAccessibleForFree; |
292
|
|
|
return $this; |
293
|
|
|
} |
294
|
|
|
|
295
|
|
|
private $_location; |
296
|
|
|
|
297
|
|
|
/** |
298
|
|
|
* @return Place|PostalAddress|string |
299
|
|
|
*/ |
300
|
|
|
public function getLocation() |
301
|
|
|
{ |
302
|
|
|
return $this->_location; |
303
|
|
|
} |
304
|
|
|
|
305
|
|
|
/** |
306
|
|
|
* The location of for example where the event is happening, an organization is located, |
307
|
|
|
* or where an action takes place. |
308
|
|
|
* |
309
|
|
|
* @param Place|PostalAddress|string $location |
310
|
|
|
* @return EventTrait |
|
|
|
|
311
|
|
|
*/ |
312
|
|
|
public function setLocation($location) |
313
|
|
|
{ |
314
|
|
|
$this->_location = $location; |
315
|
|
|
return $this; |
316
|
|
|
} |
317
|
|
|
|
318
|
|
|
private $_maximumAttendeeCapacity; |
319
|
|
|
|
320
|
|
|
/** |
321
|
|
|
* @return int |
322
|
|
|
*/ |
323
|
|
|
public function getMaximumAttendeeCapacity() |
324
|
|
|
{ |
325
|
|
|
return $this->_maximumAttendeeCapacity; |
326
|
|
|
} |
327
|
|
|
|
328
|
|
|
/** |
329
|
|
|
* The total number of individuals that may attend an event or venue. |
330
|
|
|
* |
331
|
|
|
* @param int $maximumAttendeeCapacity |
332
|
|
|
*/ |
333
|
|
|
public function setMaximumAttendeeCapacity($maximumAttendeeCapacity) |
334
|
|
|
{ |
335
|
|
|
$this->_maximumAttendeeCapacity = $maximumAttendeeCapacity; |
336
|
|
|
} |
337
|
|
|
|
338
|
|
|
private $_organizer; |
339
|
|
|
|
340
|
|
|
/** |
341
|
|
|
* @return Organization|Person |
342
|
|
|
*/ |
343
|
|
|
public function getOrganizer() |
344
|
|
|
{ |
345
|
|
|
return $this->_organizer; |
346
|
|
|
} |
347
|
|
|
|
348
|
|
|
/** |
349
|
|
|
* An organizer of an Event. |
350
|
|
|
* |
351
|
|
|
* @param Organization|Person $organizer |
352
|
|
|
* @return EventTrait |
|
|
|
|
353
|
|
|
*/ |
354
|
|
View Code Duplication |
public function setOrganizer($organizer) |
|
|
|
|
355
|
|
|
{ |
356
|
|
|
ObjectHelper::isInstanceOf($organizer, [Organization::class, PersonInterface::class]); |
|
|
|
|
357
|
|
|
|
358
|
|
|
$this->_organizer = $organizer; |
359
|
|
|
return $this; |
360
|
|
|
} |
361
|
|
|
|
362
|
|
|
private $_performer; |
363
|
|
|
|
364
|
|
|
/** |
365
|
|
|
* @return Organization|Person |
366
|
|
|
*/ |
367
|
|
|
public function getPerformer() |
368
|
|
|
{ |
369
|
|
|
return $this->_performer; |
370
|
|
|
} |
371
|
|
|
|
372
|
|
|
/** |
373
|
|
|
* A performer at the event—for example, a presenter, musician, musical group or actor. |
374
|
|
|
* Supersedes performers. |
375
|
|
|
* |
376
|
|
|
* @param Organization|Person $performer |
377
|
|
|
* @return EventTrait |
|
|
|
|
378
|
|
|
*/ |
379
|
|
View Code Duplication |
public function setPerformer($performer) |
|
|
|
|
380
|
|
|
{ |
381
|
|
|
ObjectHelper::isInstanceOf($performer, [Organization::class, PersonInterface::class]); |
|
|
|
|
382
|
|
|
|
383
|
|
|
$this->_performer = $performer; |
384
|
|
|
return $this; |
385
|
|
|
} |
386
|
|
|
|
387
|
|
|
private $_previousStartDate; |
388
|
|
|
|
389
|
|
|
/** |
390
|
|
|
* @return string |
391
|
|
|
*/ |
392
|
|
|
public function getPreviousStartDate() |
393
|
|
|
{ |
394
|
|
|
return $this->_previousStartDate; |
395
|
|
|
} |
396
|
|
|
|
397
|
|
|
/** |
398
|
|
|
* Used in conjunction with eventStatus for rescheduled or cancelled events. |
399
|
|
|
* This property contains the previously scheduled start date. |
400
|
|
|
* For rescheduled events, the startDate property should be used for the newly scheduled start date. |
401
|
|
|
* In the (rare) case of an event that has been postponed and rescheduled multiple times, |
402
|
|
|
* this field may be repeated. |
403
|
|
|
* |
404
|
|
|
* @param DateValue $previousStartDate |
405
|
|
|
* @return EventTrait |
|
|
|
|
406
|
|
|
*/ |
407
|
|
|
public function setPreviousStartDate(DateValue $previousStartDate) |
408
|
|
|
{ |
409
|
|
|
$this->_previousStartDate = $previousStartDate; |
410
|
|
|
return $this; |
411
|
|
|
} |
412
|
|
|
|
413
|
|
|
private $_recordedIn; |
414
|
|
|
|
415
|
|
|
/** |
416
|
|
|
* @return CreativeWork |
417
|
|
|
*/ |
418
|
|
|
public function getRecordedIn() |
419
|
|
|
{ |
420
|
|
|
return $this->_recordedIn; |
421
|
|
|
} |
422
|
|
|
|
423
|
|
|
/** |
424
|
|
|
* The CreativeWork that captured all or part of this Event. |
425
|
|
|
* Inverse property: recordedAt |
426
|
|
|
* |
427
|
|
|
* @param CreativeWork $recordedIn |
428
|
|
|
* @return EventTrait |
|
|
|
|
429
|
|
|
*/ |
430
|
|
|
public function setRecordedIn(CreativeWork $recordedIn) |
431
|
|
|
{ |
432
|
|
|
$this->_recordedIn = $recordedIn; |
433
|
|
|
return $this; |
434
|
|
|
} |
435
|
|
|
|
436
|
|
|
private $_remainingAttendeeCapacity; |
437
|
|
|
|
438
|
|
|
/** |
439
|
|
|
* @return int |
440
|
|
|
*/ |
441
|
|
|
public function getRemainingAttendeeCapacity() |
442
|
|
|
{ |
443
|
|
|
return $this->_remainingAttendeeCapacity; |
444
|
|
|
} |
445
|
|
|
|
446
|
|
|
/** |
447
|
|
|
* The number of attendee places for an event that remain unallocated. |
448
|
|
|
* |
449
|
|
|
* @param int $remainingAttendeeCapacity |
450
|
|
|
* @return EventTrait |
|
|
|
|
451
|
|
|
*/ |
452
|
|
|
public function setRemainingAttendeeCapacity($remainingAttendeeCapacity) |
453
|
|
|
{ |
454
|
|
|
$this->_remainingAttendeeCapacity = $remainingAttendeeCapacity; |
455
|
|
|
return $this; |
456
|
|
|
} |
457
|
|
|
|
458
|
|
|
private $_sponsor; |
459
|
|
|
|
460
|
|
|
/** |
461
|
|
|
* @return Organization|Person |
462
|
|
|
*/ |
463
|
|
|
public function getSponsor() |
464
|
|
|
{ |
465
|
|
|
return $this->_sponsor; |
466
|
|
|
} |
467
|
|
|
|
468
|
|
|
/** |
469
|
|
|
* A person or organization that supports a thing through a pledge, promise, or financial contribution. |
470
|
|
|
* e.g. a sponsor of a Medical Study or a corporate sponsor of an event. |
471
|
|
|
* |
472
|
|
|
* @param Organization|Person $sponsor |
473
|
|
|
* @return EventTrait |
|
|
|
|
474
|
|
|
*/ |
475
|
|
View Code Duplication |
public function setSponsor($sponsor) |
|
|
|
|
476
|
|
|
{ |
477
|
|
|
ObjectHelper::isInstanceOf($sponsor, [Organization::class, PersonInterface::class]); |
|
|
|
|
478
|
|
|
|
479
|
|
|
$this->_sponsor = $sponsor; |
480
|
|
|
return $this; |
481
|
|
|
} |
482
|
|
|
|
483
|
|
|
private $_startDate; |
484
|
|
|
|
485
|
|
|
/** |
486
|
|
|
* @return Date|DateTime |
487
|
|
|
*/ |
488
|
|
|
public function getStartDate() |
489
|
|
|
{ |
490
|
|
|
return $this->_startDate; |
491
|
|
|
} |
492
|
|
|
|
493
|
|
|
/** |
494
|
|
|
* The start date and time of the item (in ISO 8601 date format). |
495
|
|
|
* |
496
|
|
|
* @param DateTimeValue $startDate |
497
|
|
|
* @return EventTrait |
|
|
|
|
498
|
|
|
*/ |
499
|
|
|
public function setStartDate(DateTimeValue $startDate) |
500
|
|
|
{ |
501
|
|
|
$this->_startDate = $startDate; |
502
|
|
|
return $this; |
503
|
|
|
} |
504
|
|
|
|
505
|
|
|
private $_subEvent; |
506
|
|
|
|
507
|
|
|
/** |
508
|
|
|
* @return Event |
509
|
|
|
*/ |
510
|
|
|
public function getSubEvent() |
511
|
|
|
{ |
512
|
|
|
return $this->_subEvent; |
513
|
|
|
} |
514
|
|
|
|
515
|
|
|
/** |
516
|
|
|
* An Event that is part of this event. |
517
|
|
|
* For example, a conference event includes many presentations, each of which is a subEvent of the conference. |
518
|
|
|
* Supersedes subEvents. |
519
|
|
|
* Inverse property: superEvent. |
520
|
|
|
* |
521
|
|
|
* @param Event $subEvent |
522
|
|
|
*/ |
523
|
|
|
public function setSubEvent(Event $subEvent) |
524
|
|
|
{ |
525
|
|
|
$this->_subEvent = $subEvent; |
526
|
|
|
} |
527
|
|
|
|
528
|
|
|
private $_superEvent; |
529
|
|
|
|
530
|
|
|
/** |
531
|
|
|
* @return Event |
532
|
|
|
*/ |
533
|
|
|
public function getSuperEvent() |
534
|
|
|
{ |
535
|
|
|
return $this->_superEvent; |
536
|
|
|
} |
537
|
|
|
|
538
|
|
|
/** |
539
|
|
|
* An event that this event is a part of. |
540
|
|
|
* For example, a collection of individual music performances might each have a music festival as their superEvent. |
541
|
|
|
* Inverse property: subEvent. |
542
|
|
|
* |
543
|
|
|
* @param Event $superEvent |
544
|
|
|
* @return EventTrait |
|
|
|
|
545
|
|
|
*/ |
546
|
|
|
public function setSuperEvent(Event $superEvent) |
547
|
|
|
{ |
548
|
|
|
$this->_superEvent = $superEvent; |
549
|
|
|
return $this; |
550
|
|
|
} |
551
|
|
|
|
552
|
|
|
private $_translator; |
553
|
|
|
|
554
|
|
|
/** |
555
|
|
|
* @return Organization|Person |
556
|
|
|
*/ |
557
|
|
|
public function getTranslator() |
558
|
|
|
{ |
559
|
|
|
return $this->_translator; |
560
|
|
|
} |
561
|
|
|
|
562
|
|
|
/** |
563
|
|
|
* Organization or person who adapts a creative work to different languages, regional differences |
564
|
|
|
* and technical requirements of a target market, or that translates during some event. |
565
|
|
|
* |
566
|
|
|
* @param Organization|Person $translator |
567
|
|
|
* @return EventTrait |
|
|
|
|
568
|
|
|
*/ |
569
|
|
View Code Duplication |
public function setTranslator($translator) |
|
|
|
|
570
|
|
|
{ |
571
|
|
|
ObjectHelper::isInstanceOf($translator, [Organization::class, PersonInterface::class]); |
|
|
|
|
572
|
|
|
|
573
|
|
|
$this->_translator = $translator; |
574
|
|
|
return $this; |
575
|
|
|
} |
576
|
|
|
|
577
|
|
|
private $_typicalAgeRange; |
578
|
|
|
|
579
|
|
|
/** |
580
|
|
|
* @return string |
581
|
|
|
*/ |
582
|
|
|
public function getTypicalAgeRange() |
583
|
|
|
{ |
584
|
|
|
return $this->_typicalAgeRange; |
585
|
|
|
} |
586
|
|
|
|
587
|
|
|
/** |
588
|
|
|
* The typical expected age range, e.g. '7-9', '11-'. |
589
|
|
|
* |
590
|
|
|
* @param string $typicalAgeRange |
591
|
|
|
* @return EventTrait |
|
|
|
|
592
|
|
|
*/ |
593
|
|
|
public function setTypicalAgeRange($typicalAgeRange) |
594
|
|
|
{ |
595
|
|
|
$this->_typicalAgeRange = $typicalAgeRange; |
596
|
|
|
return $this; |
597
|
|
|
} |
598
|
|
|
|
599
|
|
|
private $_workFeatured; |
600
|
|
|
|
601
|
|
|
/** |
602
|
|
|
* @return CreativeWork |
603
|
|
|
*/ |
604
|
|
|
public function getWorkFeatured() |
605
|
|
|
{ |
606
|
|
|
return $this->_workFeatured; |
607
|
|
|
} |
608
|
|
|
|
609
|
|
|
/** |
610
|
|
|
* A work featured in some event, e.g. exhibited in an ExhibitionEvent. |
611
|
|
|
* Specific subproperties are available for workPerformed (e.g. a play), |
612
|
|
|
* or a workPresented (a Movie at a ScreeningEvent). |
613
|
|
|
* |
614
|
|
|
* @param CreativeWork $workFeatured |
615
|
|
|
* @return EventTrait |
|
|
|
|
616
|
|
|
*/ |
617
|
|
|
public function setWorkFeatured(CreativeWork $workFeatured) |
618
|
|
|
{ |
619
|
|
|
$this->_workFeatured = $workFeatured; |
620
|
|
|
return $this; |
621
|
|
|
} |
622
|
|
|
|
623
|
|
|
private $_workPerformed; |
624
|
|
|
|
625
|
|
|
/** |
626
|
|
|
* @return CreativeWork |
627
|
|
|
*/ |
628
|
|
|
public function getWorkPerformed() |
629
|
|
|
{ |
630
|
|
|
return $this->_workPerformed; |
631
|
|
|
} |
632
|
|
|
|
633
|
|
|
/** |
634
|
|
|
* A work performed in some event, for example a play performed in a TheaterEvent. |
635
|
|
|
* |
636
|
|
|
* @param CreativeWork $workPerformed |
637
|
|
|
* @return EventTrait |
|
|
|
|
638
|
|
|
*/ |
639
|
|
|
public function setWorkPerformed(CreativeWork $workPerformed) |
640
|
|
|
{ |
641
|
|
|
$this->_workPerformed = $workPerformed; |
642
|
|
|
return $this; |
643
|
|
|
} |
644
|
|
|
} |
645
|
|
|
|
In PHP traits cannot be used for type-hinting as they do not define a well-defined structure. This is because any class that uses a trait can rename that trait’s methods.
If you would like to return an object that has a guaranteed set of methods, you could create a companion interface that lists these methods explicitly.