1
|
|
|
<?php |
2
|
|
|
namespace luya\web\jsonld; |
3
|
|
|
|
4
|
|
|
/** |
5
|
|
|
* JsonLd - Service trait |
6
|
|
|
* |
7
|
|
|
* A service provided by an organization, e.g. delivery service, print services, etc. |
8
|
|
|
* |
9
|
|
|
* @see http://schema.org/Service |
10
|
|
|
* |
11
|
|
|
* @author Alex Schmid <[email protected]> |
12
|
|
|
* @since 1.0.19 |
13
|
|
|
*/ |
14
|
|
|
trait ServiceTrait |
15
|
|
|
{ |
16
|
|
|
private $_aggregateRating; |
17
|
|
|
|
18
|
|
|
/** |
19
|
|
|
* Set aggregate rating |
20
|
|
|
* |
21
|
|
|
* The overall rating, based on a collection of reviews or ratings, of the item. |
22
|
|
|
* |
23
|
|
|
* @param AggregateRating $rating |
|
|
|
|
24
|
|
|
* @return static |
25
|
|
|
*/ |
26
|
|
|
public function setAggregateRating($aggregateRating) |
27
|
|
|
{ |
28
|
|
|
$this->_aggregateRating = $aggregateRating; |
29
|
|
|
|
30
|
|
|
return $this; |
31
|
|
|
} |
32
|
|
|
|
33
|
|
|
/** |
34
|
|
|
* Get aggregate rating |
35
|
|
|
* |
36
|
|
|
* @return string |
37
|
|
|
*/ |
38
|
|
|
public function getAggregateRating() |
39
|
|
|
{ |
40
|
|
|
return $this->_aggregateRating; |
41
|
|
|
} |
42
|
|
|
|
43
|
|
|
private $_areaServed; |
44
|
|
|
|
45
|
|
|
/** |
46
|
|
|
* Set area served |
47
|
|
|
* |
48
|
|
|
* The geographic area where a service or offered item is provided. Supersedes serviceArea. |
49
|
|
|
* |
50
|
|
|
* @param mixed $areaServed |
51
|
|
|
* @return static |
52
|
|
|
*/ |
53
|
|
|
public function setAreaServed($areaServed) |
54
|
|
|
{ |
55
|
|
|
$this->_areaServed = $areaServed; |
56
|
|
|
|
57
|
|
|
return $this; |
58
|
|
|
} |
59
|
|
|
|
60
|
|
|
/** |
61
|
|
|
* Get area served |
62
|
|
|
* |
63
|
|
|
* @return string |
64
|
|
|
*/ |
65
|
|
|
public function getAreaServed() |
66
|
|
|
{ |
67
|
|
|
return $this->_areaServed; |
68
|
|
|
} |
69
|
|
|
|
70
|
|
|
private $_audience; |
71
|
|
|
|
72
|
|
|
/** |
73
|
|
|
* Set the audience. |
74
|
|
|
* |
75
|
|
|
* An intended audience, i.e. a group for whom something was created. Supersedes serviceAudience. |
76
|
|
|
* |
77
|
|
|
* @param Audience $audience |
78
|
|
|
* @return static |
79
|
|
|
*/ |
80
|
|
|
public function setAudience($audience) |
81
|
|
|
{ |
82
|
|
|
$this->_audience = $audience; |
83
|
|
|
return $this; |
84
|
|
|
} |
85
|
|
|
|
86
|
|
|
/** |
87
|
|
|
* Get the audience |
88
|
|
|
* |
89
|
|
|
* @return string |
90
|
|
|
*/ |
91
|
|
|
public function getAudience() |
92
|
|
|
{ |
93
|
|
|
return $this->_audience; |
94
|
|
|
} |
95
|
|
|
|
96
|
|
|
private $_availableChannel; |
97
|
|
|
|
98
|
|
|
/** |
99
|
|
|
* Set available channel |
100
|
|
|
* |
101
|
|
|
* A means of accessing the service (e.g. a phone bank, a web site, a location, etc.). |
102
|
|
|
* |
103
|
|
|
* @param ServiceChannel $availableChannel |
104
|
|
|
* @return static |
105
|
|
|
*/ |
106
|
|
|
public function setAvailableChannel($availableChannel) |
107
|
|
|
{ |
108
|
|
|
$this->_availableChannel = $availableChannel; |
109
|
|
|
return $this; |
110
|
|
|
} |
111
|
|
|
|
112
|
|
|
/** |
113
|
|
|
* Get available channel |
114
|
|
|
* |
115
|
|
|
* @return string |
116
|
|
|
*/ |
117
|
|
|
public function getAvailableChannel() |
118
|
|
|
{ |
119
|
|
|
return $this->_availableChannel; |
120
|
|
|
} |
121
|
|
|
|
122
|
|
|
private $_award; |
123
|
|
|
|
124
|
|
|
/** |
125
|
|
|
* Set an award |
126
|
|
|
* |
127
|
|
|
* An award won by or for this item. Supersedes awards. |
128
|
|
|
* |
129
|
|
|
* @param mixed $award |
130
|
|
|
* @return static |
131
|
|
|
*/ |
132
|
|
|
public function setAward($award) |
133
|
|
|
{ |
134
|
|
|
$this->_award = $award; |
135
|
|
|
|
136
|
|
|
return $this; |
137
|
|
|
} |
138
|
|
|
|
139
|
|
|
/** |
140
|
|
|
* Get the award |
141
|
|
|
* |
142
|
|
|
* @return string |
143
|
|
|
*/ |
144
|
|
|
public function getAward() |
145
|
|
|
{ |
146
|
|
|
return $this->_award; |
147
|
|
|
} |
148
|
|
|
|
149
|
|
|
private $_brand; |
150
|
|
|
|
151
|
|
|
/** |
152
|
|
|
* Set a brand |
153
|
|
|
* |
154
|
|
|
* The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person. |
155
|
|
|
* |
156
|
|
|
* @param mixed $brand |
157
|
|
|
* @return static |
158
|
|
|
*/ |
159
|
|
|
public function setBrand($brand) |
160
|
|
|
{ |
161
|
|
|
$this->_brand = $brand; |
162
|
|
|
return $this; |
163
|
|
|
} |
164
|
|
|
|
165
|
|
|
/** |
166
|
|
|
* Get the brand |
167
|
|
|
* |
168
|
|
|
* @return string |
169
|
|
|
*/ |
170
|
|
|
public function getBrand() |
171
|
|
|
{ |
172
|
|
|
return $this->_brand; |
173
|
|
|
} |
174
|
|
|
|
175
|
|
|
private $_broker; |
176
|
|
|
|
177
|
|
|
/** |
178
|
|
|
* Set the broker |
179
|
|
|
* |
180
|
|
|
* An entity that arranges for an exchange between a buyer and a seller. In most cases a broker never acquires or |
181
|
|
|
* releases ownership of a product or service involved in an exchange. If it is not clear whether an entity is a |
182
|
|
|
* broker, seller, or buyer, the latter two terms are preferred. Supersedes bookingAgent. |
183
|
|
|
* |
184
|
|
|
* @param mixed $broker |
185
|
|
|
* @return static |
186
|
|
|
*/ |
187
|
|
|
public function setBroker($broker) |
188
|
|
|
{ |
189
|
|
|
$this->_broker = $broker; |
190
|
|
|
|
191
|
|
|
return $this; |
192
|
|
|
} |
193
|
|
|
|
194
|
|
|
/** |
195
|
|
|
* Get the broker |
196
|
|
|
* |
197
|
|
|
* @return string |
198
|
|
|
*/ |
199
|
|
|
public function getBroker() |
200
|
|
|
{ |
201
|
|
|
return $this->_broker; |
202
|
|
|
} |
203
|
|
|
|
204
|
|
|
private $_category; |
205
|
|
|
|
206
|
|
|
/** |
207
|
|
|
* Set the category |
208
|
|
|
* |
209
|
|
|
* A category for the item. Greater signs or slashes can be used to informally indicate a category hierarchy. |
210
|
|
|
* |
211
|
|
|
* @param mixed $category |
212
|
|
|
* @return static |
213
|
|
|
*/ |
214
|
|
|
public function setCategory($category) |
215
|
|
|
{ |
216
|
|
|
$this->_category = $category; |
217
|
|
|
|
218
|
|
|
return $this; |
219
|
|
|
} |
220
|
|
|
|
221
|
|
|
/** |
222
|
|
|
* Get the category |
223
|
|
|
* |
224
|
|
|
* @return string |
225
|
|
|
*/ |
226
|
|
|
public function getCategory() |
227
|
|
|
{ |
228
|
|
|
return $this->_category; |
229
|
|
|
} |
230
|
|
|
|
231
|
|
|
private $_hasOfferCatalog; |
232
|
|
|
|
233
|
|
|
/** |
234
|
|
|
* Set whether service has an offer catalog |
235
|
|
|
* |
236
|
|
|
* Indicates an OfferCatalog listing for this Organization, Person, or Service. |
237
|
|
|
* |
238
|
|
|
* @param mixed $hasOfferCatalog |
239
|
|
|
* @return static |
240
|
|
|
*/ |
241
|
|
|
public function setHasOfferCatalog($hasOfferCatalog) |
242
|
|
|
{ |
243
|
|
|
$this->_hasOfferCatalog = $hasOfferCatalog; |
244
|
|
|
|
245
|
|
|
return $this; |
246
|
|
|
} |
247
|
|
|
|
248
|
|
|
/** |
249
|
|
|
* Get the offer catalog indication |
250
|
|
|
* |
251
|
|
|
* @return string |
252
|
|
|
*/ |
253
|
|
|
public function getHasOfferCatalog() |
254
|
|
|
{ |
255
|
|
|
return $this->_hasOfferCatalog; |
256
|
|
|
} |
257
|
|
|
|
258
|
|
|
private $_hoursAvailable; |
259
|
|
|
|
260
|
|
|
/** |
261
|
|
|
* Set the hours available |
262
|
|
|
* |
263
|
|
|
* The hours during which this service or contact is available. |
264
|
|
|
* |
265
|
|
|
* @param mixed $hoursAvailable |
266
|
|
|
* @return static |
267
|
|
|
*/ |
268
|
|
|
public function setHoursAvailable($hoursAvailable) |
269
|
|
|
{ |
270
|
|
|
$this->_hoursAvailable = $hoursAvailable; |
271
|
|
|
|
272
|
|
|
return $this; |
273
|
|
|
} |
274
|
|
|
|
275
|
|
|
/** |
276
|
|
|
* Get the hours available |
277
|
|
|
* |
278
|
|
|
* @return string |
279
|
|
|
*/ |
280
|
|
|
public function getHoursAvailable() |
281
|
|
|
{ |
282
|
|
|
return $this->_hoursAvailable; |
283
|
|
|
} |
284
|
|
|
|
285
|
|
|
private $_isRelatedTo; |
286
|
|
|
|
287
|
|
|
/** |
288
|
|
|
* Set a related product |
289
|
|
|
* |
290
|
|
|
* A pointer to another, somehow related product (or multiple products). |
291
|
|
|
* |
292
|
|
|
* @param mixed $isRelatedTo |
293
|
|
|
* @return static |
294
|
|
|
*/ |
295
|
|
|
public function setIsRelatedTo($isRelatedTo) |
296
|
|
|
{ |
297
|
|
|
$this->_isRelatedTo = $isRelatedTo; |
298
|
|
|
return $this; |
299
|
|
|
} |
300
|
|
|
|
301
|
|
|
/** |
302
|
|
|
* Get related items |
303
|
|
|
* |
304
|
|
|
* @return string |
305
|
|
|
*/ |
306
|
|
|
public function getIsRelatedTo() |
307
|
|
|
{ |
308
|
|
|
return $this->_isRelatedTo; |
309
|
|
|
} |
310
|
|
|
|
311
|
|
|
private $_isSimilarTo; |
312
|
|
|
|
313
|
|
|
/** |
314
|
|
|
* Set similar items |
315
|
|
|
* |
316
|
|
|
* A pointer to another, functionally similar product (or multiple products). |
317
|
|
|
* |
318
|
|
|
* @param mixed $isSimilarTo |
319
|
|
|
* @return static |
320
|
|
|
*/ |
321
|
|
|
public function setIsSimilarTo($isSimilarTo) |
322
|
|
|
{ |
323
|
|
|
$this->_isSimilarTo = $isSimilarTo; |
324
|
|
|
|
325
|
|
|
return $this; |
326
|
|
|
} |
327
|
|
|
|
328
|
|
|
/** |
329
|
|
|
* Get similar items |
330
|
|
|
* |
331
|
|
|
* @return string |
332
|
|
|
*/ |
333
|
|
|
public function getIsSimilarTo() |
334
|
|
|
{ |
335
|
|
|
return $this->_isSimilarTo; |
336
|
|
|
} |
337
|
|
|
|
338
|
|
|
private $_logo; |
339
|
|
|
|
340
|
|
|
/** |
341
|
|
|
* Set the logo |
342
|
|
|
* |
343
|
|
|
* An associated logo. |
344
|
|
|
* |
345
|
|
|
* @param mixed $logo |
346
|
|
|
* @return static |
347
|
|
|
*/ |
348
|
|
|
public function setLogo($logo) |
349
|
|
|
{ |
350
|
|
|
$this->_logo = $logo; |
351
|
|
|
|
352
|
|
|
return $this; |
353
|
|
|
} |
354
|
|
|
|
355
|
|
|
/** |
356
|
|
|
* Get the logo |
357
|
|
|
* |
358
|
|
|
* @return string |
359
|
|
|
*/ |
360
|
|
|
public function getLogo() |
361
|
|
|
{ |
362
|
|
|
return $this->_logo; |
363
|
|
|
} |
364
|
|
|
|
365
|
|
|
private $_offers; |
366
|
|
|
|
367
|
|
|
/** |
368
|
|
|
* Set offers |
369
|
|
|
* |
370
|
|
|
* An offer to provide this item—for example, an offer to sell a product, rent the DVD of a movie, perform a service, |
371
|
|
|
* or give away tickets to an event. |
372
|
|
|
* |
373
|
|
|
* @param mixed $offers |
374
|
|
|
* @return static |
375
|
|
|
*/ |
376
|
|
|
public function setOffers($offers) |
377
|
|
|
{ |
378
|
|
|
$this->_offers = $offers; |
379
|
|
|
|
380
|
|
|
return $this; |
381
|
|
|
} |
382
|
|
|
|
383
|
|
|
/** |
384
|
|
|
* Get offers |
385
|
|
|
* |
386
|
|
|
* @return string |
387
|
|
|
*/ |
388
|
|
|
public function getOffers() |
389
|
|
|
{ |
390
|
|
|
return $this->_offers; |
391
|
|
|
} |
392
|
|
|
|
393
|
|
|
private $_provider; |
394
|
|
|
|
395
|
|
|
/** |
396
|
|
|
* Set the service provider |
397
|
|
|
* |
398
|
|
|
* The service provider, service operator, or service performer; the goods producer. Another party (a seller) may offer those services or goods on behalf of the provider. A provider may also serve as the seller. Supersedes carrier. |
399
|
|
|
* |
400
|
|
|
* @param mixed $provider |
401
|
|
|
* @return static |
402
|
|
|
*/ |
403
|
|
|
public function setProvider($provider) |
404
|
|
|
{ |
405
|
|
|
$this->_provider = $provider; |
406
|
|
|
|
407
|
|
|
return $this; |
408
|
|
|
} |
409
|
|
|
|
410
|
|
|
/** |
411
|
|
|
* Get the provider |
412
|
|
|
* |
413
|
|
|
* @return string |
414
|
|
|
*/ |
415
|
|
|
public function getProvider() |
416
|
|
|
{ |
417
|
|
|
return $this->_provider; |
418
|
|
|
} |
419
|
|
|
|
420
|
|
|
private $_providerMobility; |
421
|
|
|
|
422
|
|
|
/** |
423
|
|
|
* Set the provider mobility |
424
|
|
|
* |
425
|
|
|
* Indicates the mobility of a provided service (e.g. 'static', 'dynamic'). |
426
|
|
|
* |
427
|
|
|
* @param mixed $providerMobility |
428
|
|
|
* @return static |
429
|
|
|
*/ |
430
|
|
|
public function setProviderMobility($providerMobility) |
431
|
|
|
{ |
432
|
|
|
$this->_providerMobility = $providerMobility; |
433
|
|
|
|
434
|
|
|
return $this; |
435
|
|
|
} |
436
|
|
|
|
437
|
|
|
/** |
438
|
|
|
* Get the provider mobility |
439
|
|
|
* |
440
|
|
|
* @return string |
441
|
|
|
*/ |
442
|
|
|
public function getProviderMobility() |
443
|
|
|
{ |
444
|
|
|
return $this->_providerMobility; |
445
|
|
|
} |
446
|
|
|
|
447
|
|
|
private $_review; |
448
|
|
|
|
449
|
|
|
/** |
450
|
|
|
* Set a review |
451
|
|
|
* |
452
|
|
|
* A review of the item. Supersedes reviews. |
453
|
|
|
* |
454
|
|
|
* @param mixed $review |
455
|
|
|
* @return static |
456
|
|
|
*/ |
457
|
|
|
public function setReview($review) |
458
|
|
|
{ |
459
|
|
|
$this->_review = $review; |
460
|
|
|
|
461
|
|
|
return $this; |
462
|
|
|
} |
463
|
|
|
|
464
|
|
|
/** |
465
|
|
|
* Get a review |
466
|
|
|
* |
467
|
|
|
* @return string |
468
|
|
|
*/ |
469
|
|
|
public function getReview() |
470
|
|
|
{ |
471
|
|
|
return $this->_review; |
472
|
|
|
} |
473
|
|
|
|
474
|
|
|
private $_serviceOutput; |
475
|
|
|
|
476
|
|
|
/** |
477
|
|
|
* Set the service output |
478
|
|
|
* |
479
|
|
|
* The tangible thing generated by the service, e.g. a passport, permit, etc. Supersedes produces. |
480
|
|
|
* |
481
|
|
|
* @param mixed $serviceOutput |
482
|
|
|
* @return static |
483
|
|
|
*/ |
484
|
|
|
public function setServiceOutput($serviceOutput) |
485
|
|
|
{ |
486
|
|
|
$this->_serviceOutput = $serviceOutput; |
487
|
|
|
|
488
|
|
|
return $this; |
489
|
|
|
} |
490
|
|
|
|
491
|
|
|
/** |
492
|
|
|
* Get the service output |
493
|
|
|
* |
494
|
|
|
* @return string |
495
|
|
|
*/ |
496
|
|
|
public function getServiceOutput() |
497
|
|
|
{ |
498
|
|
|
return $this->_serviceOutput; |
499
|
|
|
} |
500
|
|
|
|
501
|
|
|
private $_serviceType; |
502
|
|
|
|
503
|
|
|
/** |
504
|
|
|
* Set the service type |
505
|
|
|
* |
506
|
|
|
* The type of service being offered, e.g. veterans' benefits, emergency relief, etc. |
507
|
|
|
* |
508
|
|
|
* @param mixed $serviceType |
509
|
|
|
* @return static |
510
|
|
|
*/ |
511
|
|
|
public function setServiceType($serviceType) |
512
|
|
|
{ |
513
|
|
|
$this->_serviceType = $serviceType; |
514
|
|
|
|
515
|
|
|
return $this; |
516
|
|
|
} |
517
|
|
|
|
518
|
|
|
/** |
519
|
|
|
* Get the service type |
520
|
|
|
* |
521
|
|
|
* @return string |
522
|
|
|
*/ |
523
|
|
|
public function getServiceType() |
524
|
|
|
{ |
525
|
|
|
return $this->_serviceType; |
526
|
|
|
} |
527
|
|
|
|
528
|
|
|
private $_slogan; |
529
|
|
|
|
530
|
|
|
/** |
531
|
|
|
* Set the slogan |
532
|
|
|
* |
533
|
|
|
* A slogan or motto associated with the item. |
534
|
|
|
* |
535
|
|
|
* @param mixed $slogan |
536
|
|
|
* @return static |
537
|
|
|
*/ |
538
|
|
|
public function setSlogan($slogan) |
539
|
|
|
{ |
540
|
|
|
$this->_slogan = $slogan; |
541
|
|
|
|
542
|
|
|
return $this; |
543
|
|
|
} |
544
|
|
|
|
545
|
|
|
/** |
546
|
|
|
* Get the slogan |
547
|
|
|
* |
548
|
|
|
* @return string |
549
|
|
|
*/ |
550
|
|
|
public function getSlogan() |
551
|
|
|
{ |
552
|
|
|
return $this->_slogan; |
553
|
|
|
} |
554
|
|
|
|
555
|
|
|
private $_termsOfService; |
556
|
|
|
|
557
|
|
|
/** |
558
|
|
|
* Set the terms of service |
559
|
|
|
* |
560
|
|
|
* Human-readable terms of service documentation. |
561
|
|
|
* |
562
|
|
|
* @param mixed $termsOfService |
563
|
|
|
* @return static |
564
|
|
|
*/ |
565
|
|
|
public function setTermsOfService($termsOfService) |
566
|
|
|
{ |
567
|
|
|
$this->_termsOfService = $termsOfService; |
568
|
|
|
|
569
|
|
|
return $this; |
570
|
|
|
} |
571
|
|
|
|
572
|
|
|
/** |
573
|
|
|
* Get the terms of service |
574
|
|
|
* |
575
|
|
|
* @return string |
576
|
|
|
*/ |
577
|
|
|
public function getTermsOfService() |
578
|
|
|
{ |
579
|
|
|
return $this->_termsOfService; |
580
|
|
|
} |
581
|
|
|
} |
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function. It has, however, found a similar but not annotated parameter which might be a good fit.
Consider the following example. The parameter
$ireland
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was changed, but the annotation was not.