1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Spatie\SchemaOrg; |
4
|
|
|
|
5
|
|
|
use \Spatie\SchemaOrg\Contracts\AggregateRatingContract; |
6
|
|
|
use \Spatie\SchemaOrg\Contracts\IntangibleContract; |
7
|
|
|
use \Spatie\SchemaOrg\Contracts\RatingContract; |
8
|
|
|
use \Spatie\SchemaOrg\Contracts\ThingContract; |
9
|
|
|
|
10
|
|
|
/** |
11
|
|
|
* The average rating based on multiple ratings or reviews. |
12
|
|
|
* |
13
|
|
|
* @see http://schema.org/AggregateRating |
14
|
|
|
* |
15
|
|
|
*/ |
16
|
|
|
class AggregateRating extends BaseType implements AggregateRatingContract, IntangibleContract, RatingContract, ThingContract |
17
|
|
|
{ |
18
|
|
|
/** |
19
|
|
|
* An additional type for the item, typically used for adding more specific |
20
|
|
|
* types from external vocabularies in microdata syntax. This is a |
21
|
|
|
* relationship between something and a class that the thing is in. In RDFa |
22
|
|
|
* syntax, it is better to use the native RDFa syntax - the 'typeof' |
23
|
|
|
* attribute - for multiple types. Schema.org tools may have only weaker |
24
|
|
|
* understanding of extra types, in particular those defined externally. |
25
|
|
|
* |
26
|
|
|
* @param string|string[] $additionalType |
27
|
|
|
* |
28
|
|
|
* @return static |
29
|
|
|
* |
30
|
|
|
* @see http://schema.org/additionalType |
31
|
|
|
*/ |
32
|
|
|
public function additionalType($additionalType) |
33
|
|
|
{ |
34
|
|
|
return $this->setProperty('additionalType', $additionalType); |
35
|
|
|
} |
36
|
|
|
|
37
|
|
|
/** |
38
|
|
|
* An alias for the item. |
39
|
|
|
* |
40
|
|
|
* @param string|string[] $alternateName |
41
|
|
|
* |
42
|
|
|
* @return static |
43
|
|
|
* |
44
|
|
|
* @see http://schema.org/alternateName |
45
|
|
|
*/ |
46
|
|
|
public function alternateName($alternateName) |
47
|
|
|
{ |
48
|
|
|
return $this->setProperty('alternateName', $alternateName); |
49
|
|
|
} |
50
|
|
|
|
51
|
|
|
/** |
52
|
|
|
* The author of this content or rating. Please note that author is special |
53
|
|
|
* in that HTML 5 provides a special mechanism for indicating authorship via |
54
|
|
|
* the rel tag. That is equivalent to this and may be used interchangeably. |
55
|
|
|
* |
56
|
|
|
* @param \Spatie\SchemaOrg\Contracts\OrganizationContract|\Spatie\SchemaOrg\Contracts\OrganizationContract[]|\Spatie\SchemaOrg\Contracts\PersonContract|\Spatie\SchemaOrg\Contracts\PersonContract[] $author |
57
|
|
|
* |
58
|
|
|
* @return static |
59
|
|
|
* |
60
|
|
|
* @see http://schema.org/author |
61
|
|
|
*/ |
62
|
|
|
public function author($author) |
63
|
|
|
{ |
64
|
|
|
return $this->setProperty('author', $author); |
65
|
|
|
} |
66
|
|
|
|
67
|
|
|
/** |
68
|
|
|
* The highest value allowed in this rating system. If bestRating is |
69
|
|
|
* omitted, 5 is assumed. |
70
|
|
|
* |
71
|
|
|
* @param float|float[]|int|int[]|string|string[] $bestRating |
72
|
|
|
* |
73
|
|
|
* @return static |
74
|
|
|
* |
75
|
|
|
* @see http://schema.org/bestRating |
76
|
|
|
*/ |
77
|
|
|
public function bestRating($bestRating) |
78
|
|
|
{ |
79
|
|
|
return $this->setProperty('bestRating', $bestRating); |
80
|
|
|
} |
81
|
|
|
|
82
|
|
|
/** |
83
|
|
|
* A description of the item. |
84
|
|
|
* |
85
|
|
|
* @param string|string[] $description |
86
|
|
|
* |
87
|
|
|
* @return static |
88
|
|
|
* |
89
|
|
|
* @see http://schema.org/description |
90
|
|
|
*/ |
91
|
|
|
public function description($description) |
92
|
|
|
{ |
93
|
|
|
return $this->setProperty('description', $description); |
94
|
|
|
} |
95
|
|
|
|
96
|
|
|
/** |
97
|
|
|
* A sub property of description. A short description of the item used to |
98
|
|
|
* disambiguate from other, similar items. Information from other properties |
99
|
|
|
* (in particular, name) may be necessary for the description to be useful |
100
|
|
|
* for disambiguation. |
101
|
|
|
* |
102
|
|
|
* @param string|string[] $disambiguatingDescription |
103
|
|
|
* |
104
|
|
|
* @return static |
105
|
|
|
* |
106
|
|
|
* @see http://schema.org/disambiguatingDescription |
107
|
|
|
*/ |
108
|
|
|
public function disambiguatingDescription($disambiguatingDescription) |
109
|
|
|
{ |
110
|
|
|
return $this->setProperty('disambiguatingDescription', $disambiguatingDescription); |
111
|
|
|
} |
112
|
|
|
|
113
|
|
|
/** |
114
|
|
|
* The identifier property represents any kind of identifier for any kind of |
115
|
|
|
* [[Thing]], such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides |
116
|
|
|
* dedicated properties for representing many of these, either as textual |
117
|
|
|
* strings or as URL (URI) links. See [background |
118
|
|
|
* notes](/docs/datamodel.html#identifierBg) for more details. |
119
|
|
|
* |
120
|
|
|
* @param \Spatie\SchemaOrg\Contracts\PropertyValueContract|\Spatie\SchemaOrg\Contracts\PropertyValueContract[]|string|string[] $identifier |
121
|
|
|
* |
122
|
|
|
* @return static |
123
|
|
|
* |
124
|
|
|
* @see http://schema.org/identifier |
125
|
|
|
*/ |
126
|
|
|
public function identifier($identifier) |
127
|
|
|
{ |
128
|
|
|
return $this->setProperty('identifier', $identifier); |
129
|
|
|
} |
130
|
|
|
|
131
|
|
|
/** |
132
|
|
|
* An image of the item. This can be a [[URL]] or a fully described |
133
|
|
|
* [[ImageObject]]. |
134
|
|
|
* |
135
|
|
|
* @param \Spatie\SchemaOrg\Contracts\ImageObjectContract|\Spatie\SchemaOrg\Contracts\ImageObjectContract[]|string|string[] $image |
136
|
|
|
* |
137
|
|
|
* @return static |
138
|
|
|
* |
139
|
|
|
* @see http://schema.org/image |
140
|
|
|
*/ |
141
|
|
|
public function image($image) |
142
|
|
|
{ |
143
|
|
|
return $this->setProperty('image', $image); |
144
|
|
|
} |
145
|
|
|
|
146
|
|
|
/** |
147
|
|
|
* The item that is being reviewed/rated. |
148
|
|
|
* |
149
|
|
|
* @param \Spatie\SchemaOrg\Contracts\ThingContract|\Spatie\SchemaOrg\Contracts\ThingContract[] $itemReviewed |
150
|
|
|
* |
151
|
|
|
* @return static |
152
|
|
|
* |
153
|
|
|
* @see http://schema.org/itemReviewed |
154
|
|
|
*/ |
155
|
|
|
public function itemReviewed($itemReviewed) |
156
|
|
|
{ |
157
|
|
|
return $this->setProperty('itemReviewed', $itemReviewed); |
158
|
|
|
} |
159
|
|
|
|
160
|
|
|
/** |
161
|
|
|
* Indicates a page (or other CreativeWork) for which this thing is the main |
162
|
|
|
* entity being described. See [background |
163
|
|
|
* notes](/docs/datamodel.html#mainEntityBackground) for details. |
164
|
|
|
* |
165
|
|
|
* @param \Spatie\SchemaOrg\Contracts\CreativeWorkContract|\Spatie\SchemaOrg\Contracts\CreativeWorkContract[]|string|string[] $mainEntityOfPage |
166
|
|
|
* |
167
|
|
|
* @return static |
168
|
|
|
* |
169
|
|
|
* @see http://schema.org/mainEntityOfPage |
170
|
|
|
*/ |
171
|
|
|
public function mainEntityOfPage($mainEntityOfPage) |
172
|
|
|
{ |
173
|
|
|
return $this->setProperty('mainEntityOfPage', $mainEntityOfPage); |
174
|
|
|
} |
175
|
|
|
|
176
|
|
|
/** |
177
|
|
|
* The name of the item. |
178
|
|
|
* |
179
|
|
|
* @param string|string[] $name |
180
|
|
|
* |
181
|
|
|
* @return static |
182
|
|
|
* |
183
|
|
|
* @see http://schema.org/name |
184
|
|
|
*/ |
185
|
|
|
public function name($name) |
186
|
|
|
{ |
187
|
|
|
return $this->setProperty('name', $name); |
188
|
|
|
} |
189
|
|
|
|
190
|
|
|
/** |
191
|
|
|
* Indicates a potential Action, which describes an idealized action in |
192
|
|
|
* which this thing would play an 'object' role. |
193
|
|
|
* |
194
|
|
|
* @param \Spatie\SchemaOrg\Contracts\ActionContract|\Spatie\SchemaOrg\Contracts\ActionContract[] $potentialAction |
195
|
|
|
* |
196
|
|
|
* @return static |
197
|
|
|
* |
198
|
|
|
* @see http://schema.org/potentialAction |
199
|
|
|
*/ |
200
|
|
|
public function potentialAction($potentialAction) |
201
|
|
|
{ |
202
|
|
|
return $this->setProperty('potentialAction', $potentialAction); |
203
|
|
|
} |
204
|
|
|
|
205
|
|
|
/** |
206
|
|
|
* The count of total number of ratings. |
207
|
|
|
* |
208
|
|
|
* @param int|int[] $ratingCount |
209
|
|
|
* |
210
|
|
|
* @return static |
211
|
|
|
* |
212
|
|
|
* @see http://schema.org/ratingCount |
213
|
|
|
*/ |
214
|
|
|
public function ratingCount($ratingCount) |
215
|
|
|
{ |
216
|
|
|
return $this->setProperty('ratingCount', $ratingCount); |
217
|
|
|
} |
218
|
|
|
|
219
|
|
|
/** |
220
|
|
|
* The rating for the content. |
221
|
|
|
* |
222
|
|
|
* Usage guidelines: |
223
|
|
|
* |
224
|
|
|
* * Use values from 0123456789 (Unicode 'DIGIT ZERO' (U+0030) to 'DIGIT |
225
|
|
|
* NINE' (U+0039)) rather than superficially similiar Unicode symbols. |
226
|
|
|
* * Use '.' (Unicode 'FULL STOP' (U+002E)) rather than ',' to indicate a |
227
|
|
|
* decimal point. Avoid using these symbols as a readability separator. |
228
|
|
|
* |
229
|
|
|
* @param float|float[]|int|int[]|string|string[] $ratingValue |
230
|
|
|
* |
231
|
|
|
* @return static |
232
|
|
|
* |
233
|
|
|
* @see http://schema.org/ratingValue |
234
|
|
|
*/ |
235
|
|
|
public function ratingValue($ratingValue) |
236
|
|
|
{ |
237
|
|
|
return $this->setProperty('ratingValue', $ratingValue); |
238
|
|
|
} |
239
|
|
|
|
240
|
|
|
/** |
241
|
|
|
* This Review or Rating is relevant to this part or facet of the |
242
|
|
|
* itemReviewed. |
243
|
|
|
* |
244
|
|
|
* @param string|string[] $reviewAspect |
245
|
|
|
* |
246
|
|
|
* @return static |
247
|
|
|
* |
248
|
|
|
* @see http://schema.org/reviewAspect |
249
|
|
|
*/ |
250
|
|
|
public function reviewAspect($reviewAspect) |
251
|
|
|
{ |
252
|
|
|
return $this->setProperty('reviewAspect', $reviewAspect); |
253
|
|
|
} |
254
|
|
|
|
255
|
|
|
/** |
256
|
|
|
* The count of total number of reviews. |
257
|
|
|
* |
258
|
|
|
* @param int|int[] $reviewCount |
259
|
|
|
* |
260
|
|
|
* @return static |
261
|
|
|
* |
262
|
|
|
* @see http://schema.org/reviewCount |
263
|
|
|
*/ |
264
|
|
|
public function reviewCount($reviewCount) |
265
|
|
|
{ |
266
|
|
|
return $this->setProperty('reviewCount', $reviewCount); |
267
|
|
|
} |
268
|
|
|
|
269
|
|
|
/** |
270
|
|
|
* URL of a reference Web page that unambiguously indicates the item's |
271
|
|
|
* identity. E.g. the URL of the item's Wikipedia page, Wikidata entry, or |
272
|
|
|
* official website. |
273
|
|
|
* |
274
|
|
|
* @param string|string[] $sameAs |
275
|
|
|
* |
276
|
|
|
* @return static |
277
|
|
|
* |
278
|
|
|
* @see http://schema.org/sameAs |
279
|
|
|
*/ |
280
|
|
|
public function sameAs($sameAs) |
281
|
|
|
{ |
282
|
|
|
return $this->setProperty('sameAs', $sameAs); |
283
|
|
|
} |
284
|
|
|
|
285
|
|
|
/** |
286
|
|
|
* A CreativeWork or Event about this Thing. |
287
|
|
|
* |
288
|
|
|
* @param \Spatie\SchemaOrg\Contracts\CreativeWorkContract|\Spatie\SchemaOrg\Contracts\CreativeWorkContract[]|\Spatie\SchemaOrg\Contracts\EventContract|\Spatie\SchemaOrg\Contracts\EventContract[] $subjectOf |
289
|
|
|
* |
290
|
|
|
* @return static |
291
|
|
|
* |
292
|
|
|
* @see http://schema.org/subjectOf |
293
|
|
|
*/ |
294
|
|
|
public function subjectOf($subjectOf) |
295
|
|
|
{ |
296
|
|
|
return $this->setProperty('subjectOf', $subjectOf); |
297
|
|
|
} |
298
|
|
|
|
299
|
|
|
/** |
300
|
|
|
* URL of the item. |
301
|
|
|
* |
302
|
|
|
* @param string|string[] $url |
303
|
|
|
* |
304
|
|
|
* @return static |
305
|
|
|
* |
306
|
|
|
* @see http://schema.org/url |
307
|
|
|
*/ |
308
|
|
|
public function url($url) |
309
|
|
|
{ |
310
|
|
|
return $this->setProperty('url', $url); |
311
|
|
|
} |
312
|
|
|
|
313
|
|
|
/** |
314
|
|
|
* The lowest value allowed in this rating system. If worstRating is |
315
|
|
|
* omitted, 1 is assumed. |
316
|
|
|
* |
317
|
|
|
* @param float|float[]|int|int[]|string|string[] $worstRating |
318
|
|
|
* |
319
|
|
|
* @return static |
320
|
|
|
* |
321
|
|
|
* @see http://schema.org/worstRating |
322
|
|
|
*/ |
323
|
|
|
public function worstRating($worstRating) |
324
|
|
|
{ |
325
|
|
|
return $this->setProperty('worstRating', $worstRating); |
326
|
|
|
} |
327
|
|
|
|
328
|
|
|
} |
329
|
|
|
|