1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Viktoras\Scryfall\Entities; |
4
|
|
|
|
5
|
|
|
use Viktoras\Scryfall\Enums; |
6
|
|
|
|
7
|
|
|
class Card extends AbstractObject |
8
|
|
|
{ |
9
|
|
|
/** |
10
|
|
|
* This card’s Arena ID, if any. A large percentage of cards are not available on Arena and do not have this ID. |
11
|
|
|
* |
12
|
|
|
* @var int |
13
|
|
|
*/ |
14
|
|
|
private $arenaId; |
15
|
|
|
|
16
|
|
|
/** |
17
|
|
|
* A unique ID for this card in Scryfall’s database. |
18
|
|
|
* |
19
|
|
|
* @var string |
20
|
|
|
*/ |
21
|
|
|
private $id; |
22
|
|
|
|
23
|
|
|
/** |
24
|
|
|
* A language code for this printing. |
25
|
|
|
* |
26
|
|
|
* @var string |
27
|
|
|
*/ |
28
|
|
|
private $lang; |
29
|
|
|
|
30
|
|
|
/** |
31
|
|
|
* @var float |
32
|
|
|
*/ |
33
|
|
|
private $cmc; |
34
|
|
|
|
35
|
|
|
/** |
36
|
|
|
* @var string[] |
37
|
|
|
*/ |
38
|
|
|
private $colors; |
39
|
|
|
|
40
|
|
|
/** |
41
|
|
|
* @var array |
42
|
|
|
*/ |
43
|
|
|
private $legalities; |
44
|
|
|
|
45
|
|
|
/** |
46
|
|
|
* @var string |
47
|
|
|
*/ |
48
|
|
|
private $loyalty; |
49
|
|
|
|
50
|
|
|
/** |
51
|
|
|
* @var string |
52
|
|
|
*/ |
53
|
|
|
private $manaCost; |
54
|
|
|
|
55
|
|
|
/** |
56
|
|
|
* @var string |
57
|
|
|
*/ |
58
|
|
|
private $name; |
59
|
|
|
|
60
|
|
|
/** |
61
|
|
|
* @var string |
62
|
|
|
*/ |
63
|
|
|
private $oracleText; |
64
|
|
|
|
65
|
|
|
/** |
66
|
|
|
* @var string |
67
|
|
|
*/ |
68
|
|
|
private $power; |
69
|
|
|
|
70
|
|
|
/** |
71
|
|
|
* @var string |
72
|
|
|
*/ |
73
|
|
|
private $toughness; |
74
|
|
|
|
75
|
|
|
/** |
76
|
|
|
* @var string |
77
|
|
|
*/ |
78
|
|
|
private $artist; |
79
|
|
|
|
80
|
|
|
/** |
81
|
|
|
* @var string |
82
|
|
|
*/ |
83
|
|
|
private $set; |
84
|
|
|
|
85
|
|
|
/** |
86
|
|
|
* @var int |
87
|
|
|
*/ |
88
|
|
|
private $collectorNumber; |
89
|
|
|
|
90
|
|
|
/** |
91
|
|
|
* @var array |
92
|
|
|
*/ |
93
|
|
|
private $imageUris; |
94
|
|
|
|
95
|
|
|
/** |
96
|
|
|
* @return string |
97
|
|
|
*/ |
98
|
|
|
protected function acceptsObject(): string |
99
|
|
|
{ |
100
|
|
|
return Enums\Objects::CARD; |
101
|
|
|
} |
102
|
|
|
|
103
|
|
|
/** |
104
|
|
|
* @return int|null |
105
|
|
|
*/ |
106
|
|
|
public function getArenaId(): ?int |
107
|
|
|
{ |
108
|
|
|
return $this->arenaId; |
109
|
|
|
} |
110
|
|
|
|
111
|
|
|
/** |
112
|
|
|
* @param int $arenaId |
113
|
|
|
*/ |
114
|
|
|
public function setArenaId(int $arenaId): void |
115
|
|
|
{ |
116
|
|
|
$this->arenaId = $arenaId; |
117
|
|
|
} |
118
|
|
|
|
119
|
|
|
/** |
120
|
|
|
* @return string |
121
|
|
|
*/ |
122
|
|
|
public function getId(): string |
123
|
|
|
{ |
124
|
|
|
return $this->id; |
125
|
|
|
} |
126
|
|
|
|
127
|
|
|
/** |
128
|
|
|
* @param string $id |
129
|
|
|
*/ |
130
|
|
|
public function setId(string $id): void |
131
|
|
|
{ |
132
|
|
|
$this->id = $id; |
133
|
|
|
} |
134
|
|
|
|
135
|
|
|
/** |
136
|
|
|
* @return string |
137
|
|
|
*/ |
138
|
|
|
public function getLang(): string |
139
|
|
|
{ |
140
|
|
|
return $this->lang; |
141
|
|
|
} |
142
|
|
|
|
143
|
|
|
/** |
144
|
|
|
* @param string $lang |
145
|
|
|
*/ |
146
|
|
|
public function setLang(string $lang): void |
147
|
|
|
{ |
148
|
|
|
$this->lang = $lang; |
149
|
|
|
} |
150
|
|
|
|
151
|
|
|
/** |
152
|
|
|
* @return float |
153
|
|
|
*/ |
154
|
|
|
public function getCmc(): float |
155
|
|
|
{ |
156
|
|
|
return $this->cmc; |
157
|
|
|
} |
158
|
|
|
|
159
|
|
|
/** |
160
|
|
|
* @param float $cmc |
161
|
|
|
*/ |
162
|
|
|
public function setCmc(float $cmc): void |
163
|
|
|
{ |
164
|
|
|
$this->cmc = $cmc; |
165
|
|
|
} |
166
|
|
|
|
167
|
|
|
/** |
168
|
|
|
* @return string[] |
169
|
|
|
*/ |
170
|
|
|
public function getColors(): array |
171
|
|
|
{ |
172
|
|
|
return $this->colors; |
173
|
|
|
} |
174
|
|
|
|
175
|
|
|
/** |
176
|
|
|
* @param string[] $colors |
177
|
|
|
*/ |
178
|
|
|
public function setColors(array $colors): void |
179
|
|
|
{ |
180
|
|
|
$this->colors = $colors; |
181
|
|
|
} |
182
|
|
|
|
183
|
|
|
/** |
184
|
|
|
* @return array |
185
|
|
|
*/ |
186
|
|
|
public function getLegalities(): array |
187
|
|
|
{ |
188
|
|
|
return $this->legalities; |
189
|
|
|
} |
190
|
|
|
|
191
|
|
|
/** |
192
|
|
|
* @param array $legalities |
193
|
|
|
*/ |
194
|
|
|
public function setLegalities(array $legalities): void |
195
|
|
|
{ |
196
|
|
|
$this->legalities = $legalities; |
197
|
|
|
} |
198
|
|
|
|
199
|
|
|
/** |
200
|
|
|
* @return string|null |
201
|
|
|
*/ |
202
|
|
|
public function getLoyalty(): ?string |
203
|
|
|
{ |
204
|
|
|
return $this->loyalty; |
205
|
|
|
} |
206
|
|
|
|
207
|
|
|
/** |
208
|
|
|
* @param string $loyalty |
209
|
|
|
*/ |
210
|
|
|
public function setLoyalty(string $loyalty): void |
211
|
|
|
{ |
212
|
|
|
$this->loyalty = $loyalty; |
213
|
|
|
} |
214
|
|
|
|
215
|
|
|
/** |
216
|
|
|
* @return string |
217
|
|
|
*/ |
218
|
|
|
public function getManaCost(): string |
219
|
|
|
{ |
220
|
|
|
return $this->manaCost; |
221
|
|
|
} |
222
|
|
|
|
223
|
|
|
/** |
224
|
|
|
* @param string $manaCost |
225
|
|
|
*/ |
226
|
|
|
public function setManaCost(string $manaCost): void |
227
|
|
|
{ |
228
|
|
|
$this->manaCost = $manaCost; |
229
|
|
|
} |
230
|
|
|
|
231
|
|
|
/** |
232
|
|
|
* @return string |
233
|
|
|
*/ |
234
|
|
|
public function getName(): string |
235
|
|
|
{ |
236
|
|
|
return $this->name; |
237
|
|
|
} |
238
|
|
|
|
239
|
|
|
/** |
240
|
|
|
* @param string $name |
241
|
|
|
*/ |
242
|
|
|
public function setName(string $name): void |
243
|
|
|
{ |
244
|
|
|
$this->name = $name; |
245
|
|
|
} |
246
|
|
|
|
247
|
|
|
/** |
248
|
|
|
* @return string |
249
|
|
|
*/ |
250
|
|
|
public function getOracleText(): string |
251
|
|
|
{ |
252
|
|
|
return $this->oracleText; |
253
|
|
|
} |
254
|
|
|
|
255
|
|
|
/** |
256
|
|
|
* @param string $oracleText |
257
|
|
|
*/ |
258
|
|
|
public function setOracleText(string $oracleText): void |
259
|
|
|
{ |
260
|
|
|
$this->oracleText = $oracleText; |
261
|
|
|
} |
262
|
|
|
|
263
|
|
|
/** |
264
|
|
|
* @return string |
265
|
|
|
*/ |
266
|
|
|
public function getPower(): string |
267
|
|
|
{ |
268
|
|
|
return $this->power; |
269
|
|
|
} |
270
|
|
|
|
271
|
|
|
/** |
272
|
|
|
* @param string $power |
273
|
|
|
*/ |
274
|
|
|
public function setPower(string $power): void |
275
|
|
|
{ |
276
|
|
|
$this->power = $power; |
277
|
|
|
} |
278
|
|
|
|
279
|
|
|
/** |
280
|
|
|
* @return string |
281
|
|
|
*/ |
282
|
|
|
public function getToughness(): string |
283
|
|
|
{ |
284
|
|
|
return $this->toughness; |
285
|
|
|
} |
286
|
|
|
|
287
|
|
|
/** |
288
|
|
|
* @param string $toughness |
289
|
|
|
*/ |
290
|
|
|
public function setToughness(string $toughness): void |
291
|
|
|
{ |
292
|
|
|
$this->toughness = $toughness; |
293
|
|
|
} |
294
|
|
|
|
295
|
|
|
/** |
296
|
|
|
* @return string |
297
|
|
|
*/ |
298
|
|
|
public function getArtist(): string |
299
|
|
|
{ |
300
|
|
|
return $this->artist; |
301
|
|
|
} |
302
|
|
|
|
303
|
|
|
/** |
304
|
|
|
* @param string $artist |
305
|
|
|
*/ |
306
|
|
|
public function setArtist(string $artist): void |
307
|
|
|
{ |
308
|
|
|
$this->artist = $artist; |
309
|
|
|
} |
310
|
|
|
|
311
|
|
|
/** |
312
|
|
|
* @return string |
313
|
|
|
*/ |
314
|
|
|
public function getSet(): string |
315
|
|
|
{ |
316
|
|
|
return $this->set; |
317
|
|
|
} |
318
|
|
|
|
319
|
|
|
/** |
320
|
|
|
* @param string $set |
321
|
|
|
*/ |
322
|
|
|
public function setSet(string $set): void |
323
|
|
|
{ |
324
|
|
|
$this->set = $set; |
325
|
|
|
} |
326
|
|
|
|
327
|
|
|
/** |
328
|
|
|
* @return int |
329
|
|
|
*/ |
330
|
|
|
public function getCollectorNumber(): int |
331
|
|
|
{ |
332
|
|
|
return $this->collectorNumber; |
333
|
|
|
} |
334
|
|
|
|
335
|
|
|
/** |
336
|
|
|
* @param int $collectorNumber |
337
|
|
|
*/ |
338
|
|
|
public function setCollectorNumber(int $collectorNumber): void |
339
|
|
|
{ |
340
|
|
|
$this->collectorNumber = $collectorNumber; |
341
|
|
|
} |
342
|
|
|
|
343
|
|
|
/** |
344
|
|
|
* @return array |
345
|
|
|
*/ |
346
|
|
|
public function getImageUris(): array |
347
|
|
|
{ |
348
|
|
|
return $this->imageUris; |
349
|
|
|
} |
350
|
|
|
|
351
|
|
|
/** |
352
|
|
|
* @param array $imageUris |
353
|
|
|
*/ |
354
|
|
|
public function setImageUris(array $imageUris): void |
355
|
|
|
{ |
356
|
|
|
$this->imageUris = $imageUris; |
357
|
|
|
} |
358
|
|
|
} |
359
|
|
|
|