1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* @file |
4
|
|
|
* Contains \TheSportsDb\Entity\Proxy\EventProxy. |
5
|
|
|
*/ |
6
|
|
|
|
7
|
|
|
namespace TheSportsDb\Entity\Proxy; |
8
|
|
|
|
9
|
|
|
use TheSportsDb\Entity\EventInterface; |
10
|
|
|
|
11
|
|
|
/** |
12
|
|
|
* An event object that is not yet fully loaded. |
13
|
|
|
* |
14
|
|
|
* @author Jelle Sebreghts |
15
|
|
|
*/ |
16
|
|
|
class EventProxy extends Proxy implements EventInterface { |
17
|
|
|
|
18
|
|
|
/** |
19
|
|
|
* {@inheritdoc} |
20
|
|
|
*/ |
21
|
|
|
protected function load() { |
22
|
|
|
$eventData = $this->sportsDbClient->doRequest('lookupevent.php', array('id' => $this->properties->id)); |
23
|
|
|
if (isset($eventData->events)) { |
24
|
|
|
$this->update($this->entityManager->mapProperties(reset($eventData->events), $this->getEntityType())); |
25
|
|
|
return; |
26
|
|
|
} |
27
|
|
|
throw new \Exception('Could not fully load event with id ' . $this->properties->id . '.'); |
28
|
|
|
} |
29
|
|
|
|
30
|
|
|
/** |
31
|
|
|
* {@inheritdoc} |
32
|
|
|
*/ |
33
|
|
|
public function getAwayFormation() { |
34
|
|
|
return $this->get('awayFormation'); |
35
|
|
|
} |
36
|
|
|
|
37
|
|
|
/** |
38
|
|
|
* {@inheritdoc} |
39
|
|
|
*/ |
40
|
|
|
public function getAwayGoalDetails() { |
41
|
|
|
return $this->get('awayGoalDetails'); |
42
|
|
|
} |
43
|
|
|
|
44
|
|
|
/** |
45
|
|
|
* {@inheritdoc} |
46
|
|
|
*/ |
47
|
|
|
public function getAwayLineupDefense() { |
48
|
|
|
return $this->get('awayLineupDefense'); |
49
|
|
|
} |
50
|
|
|
|
51
|
|
|
/** |
52
|
|
|
* {@inheritdoc} |
53
|
|
|
*/ |
54
|
|
|
public function getAwayLineupForward() { |
55
|
|
|
return $this->get('awayLineupForward'); |
56
|
|
|
} |
57
|
|
|
|
58
|
|
|
/** |
59
|
|
|
* {@inheritdoc} |
60
|
|
|
*/ |
61
|
|
|
public function getAwayLineupGoalkeeper() { |
62
|
|
|
return $this->get('awayLineupGoalkeeper'); |
63
|
|
|
} |
64
|
|
|
|
65
|
|
|
/** |
66
|
|
|
* {@inheritdoc} |
67
|
|
|
*/ |
68
|
|
|
public function getAwayLineupMidfield() { |
69
|
|
|
return $this->get('awayLineupMidfield'); |
70
|
|
|
} |
71
|
|
|
|
72
|
|
|
/** |
73
|
|
|
* {@inheritdoc} |
74
|
|
|
*/ |
75
|
|
|
public function getAwayLineupSubstitutes() { |
76
|
|
|
return $this->get('awayLineupSubstitutes'); |
77
|
|
|
} |
78
|
|
|
|
79
|
|
|
/** |
80
|
|
|
* {@inheritdoc} |
81
|
|
|
*/ |
82
|
|
|
public function getAwayRedCards() { |
83
|
|
|
return $this->get('awayRedCards'); |
84
|
|
|
} |
85
|
|
|
|
86
|
|
|
/** |
87
|
|
|
* {@inheritdoc} |
88
|
|
|
*/ |
89
|
|
|
public function getAwayScore() { |
90
|
|
|
return $this->get('awayScore'); |
91
|
|
|
} |
92
|
|
|
|
93
|
|
|
/** |
94
|
|
|
* {@inheritdoc} |
95
|
|
|
*/ |
96
|
|
|
public function getAwayShots() { |
97
|
|
|
return $this->get('awayShots'); |
98
|
|
|
} |
99
|
|
|
|
100
|
|
|
/** |
101
|
|
|
* {@inheritdoc} |
102
|
|
|
*/ |
103
|
|
|
public function getAwayTeam() { |
104
|
|
|
return $this->get('awayTeam'); |
105
|
|
|
} |
106
|
|
|
|
107
|
|
|
/** |
108
|
|
|
* {@inheritdoc} |
109
|
|
|
*/ |
110
|
|
|
public function getAwayYellowCards() { |
111
|
|
|
return $this->get('awayYellowCards'); |
112
|
|
|
} |
113
|
|
|
|
114
|
|
|
/** |
115
|
|
|
* {@inheritdoc} |
116
|
|
|
*/ |
117
|
|
|
public function getBanner() { |
118
|
|
|
return $this->get('banner'); |
119
|
|
|
} |
120
|
|
|
|
121
|
|
|
/** |
122
|
|
|
* {@inheritdoc} |
123
|
|
|
*/ |
124
|
|
|
public function getCircuit() { |
125
|
|
|
return $this->get('circuit'); |
126
|
|
|
} |
127
|
|
|
|
128
|
|
|
/** |
129
|
|
|
* {@inheritdoc} |
130
|
|
|
*/ |
131
|
|
|
public function getCity() { |
132
|
|
|
return $this->get('city'); |
133
|
|
|
} |
134
|
|
|
|
135
|
|
|
/** |
136
|
|
|
* {@inheritdoc} |
137
|
|
|
*/ |
138
|
|
|
public function getCountry() { |
139
|
|
|
return $this->get('country'); |
140
|
|
|
} |
141
|
|
|
|
142
|
|
|
/** |
143
|
|
|
* {@inheritdoc} |
144
|
|
|
*/ |
145
|
|
|
public function getDate() { |
146
|
|
|
return $this->get('date'); |
147
|
|
|
} |
148
|
|
|
|
149
|
|
|
/** |
150
|
|
|
* {@inheritdoc} |
151
|
|
|
*/ |
152
|
|
|
public function getDescription() { |
153
|
|
|
return $this->get('description'); |
154
|
|
|
} |
155
|
|
|
|
156
|
|
|
/** |
157
|
|
|
* {@inheritdoc} |
158
|
|
|
*/ |
159
|
|
|
public function getFilename() { |
160
|
|
|
return $this->get('filename'); |
161
|
|
|
} |
162
|
|
|
|
163
|
|
|
/** |
164
|
|
|
* {@inheritdoc} |
165
|
|
|
*/ |
166
|
|
|
public function getHomeFormation() { |
167
|
|
|
return $this->get('homeFormation'); |
168
|
|
|
} |
169
|
|
|
|
170
|
|
|
/** |
171
|
|
|
* {@inheritdoc} |
172
|
|
|
*/ |
173
|
|
|
public function getHomeGoalDetails() { |
174
|
|
|
return $this->get('homeGoalDetails'); |
175
|
|
|
} |
176
|
|
|
|
177
|
|
|
/** |
178
|
|
|
* {@inheritdoc} |
179
|
|
|
*/ |
180
|
|
|
public function getHomeLineupDefense() { |
181
|
|
|
return $this->get('homeLineupDefense'); |
182
|
|
|
} |
183
|
|
|
|
184
|
|
|
/** |
185
|
|
|
* {@inheritdoc} |
186
|
|
|
*/ |
187
|
|
|
public function getHomeLineupForward() { |
188
|
|
|
return $this->get('homeLineupForward'); |
189
|
|
|
} |
190
|
|
|
|
191
|
|
|
/** |
192
|
|
|
* {@inheritdoc} |
193
|
|
|
*/ |
194
|
|
|
public function getHomeLineupGoalkeeper() { |
195
|
|
|
return $this->get('homeLineupGoalkeeper'); |
196
|
|
|
} |
197
|
|
|
|
198
|
|
|
/** |
199
|
|
|
* {@inheritdoc} |
200
|
|
|
*/ |
201
|
|
|
public function getHomeLineupMidfield() { |
202
|
|
|
return $this->get('homeLineupMidfield'); |
203
|
|
|
} |
204
|
|
|
|
205
|
|
|
/** |
206
|
|
|
* {@inheritdoc} |
207
|
|
|
*/ |
208
|
|
|
public function getHomeLineupSubstitutes() { |
209
|
|
|
return $this->get('homeLineupSubstitutes'); |
210
|
|
|
} |
211
|
|
|
|
212
|
|
|
/** |
213
|
|
|
* {@inheritdoc} |
214
|
|
|
*/ |
215
|
|
|
public function getHomeRedCards() { |
216
|
|
|
return $this->get('homeRedCards'); |
217
|
|
|
} |
218
|
|
|
|
219
|
|
|
/** |
220
|
|
|
* {@inheritdoc} |
221
|
|
|
*/ |
222
|
|
|
public function getHomeScore() { |
223
|
|
|
return $this->get('homeScore'); |
224
|
|
|
} |
225
|
|
|
|
226
|
|
|
/** |
227
|
|
|
* {@inheritdoc} |
228
|
|
|
*/ |
229
|
|
|
public function getHomeShots() { |
230
|
|
|
return $this->get('homeShots'); |
231
|
|
|
} |
232
|
|
|
|
233
|
|
|
/** |
234
|
|
|
* {@inheritdoc} |
235
|
|
|
*/ |
236
|
|
|
public function getHomeTeam() { |
237
|
|
|
return $this->get('homeTeam'); |
238
|
|
|
} |
239
|
|
|
|
240
|
|
|
/** |
241
|
|
|
* {@inheritdoc} |
242
|
|
|
*/ |
243
|
|
|
public function getHomeYellowCards() { |
244
|
|
|
return $this->get('homeYellowCards'); |
245
|
|
|
} |
246
|
|
|
|
247
|
|
|
/** |
248
|
|
|
* {@inheritdoc} |
249
|
|
|
*/ |
250
|
|
|
public function getId() { |
251
|
|
|
return $this->get('id'); |
252
|
|
|
} |
253
|
|
|
|
254
|
|
|
/** |
255
|
|
|
* {@inheritdoc} |
256
|
|
|
*/ |
257
|
|
|
public function getLeague() { |
258
|
|
|
return $this->get('league'); |
259
|
|
|
} |
260
|
|
|
|
261
|
|
|
/** |
262
|
|
|
* {@inheritdoc} |
263
|
|
|
*/ |
264
|
|
|
public function getLocked() { |
265
|
|
|
return $this->get('locked'); |
266
|
|
|
} |
267
|
|
|
|
268
|
|
|
/** |
269
|
|
|
* {@inheritdoc} |
270
|
|
|
*/ |
271
|
|
|
public function getMap() { |
272
|
|
|
return $this->get('map'); |
273
|
|
|
} |
274
|
|
|
|
275
|
|
|
/** |
276
|
|
|
* {@inheritdoc} |
277
|
|
|
*/ |
278
|
|
|
public function getName() { |
279
|
|
|
return $this->get('name'); |
280
|
|
|
} |
281
|
|
|
|
282
|
|
|
/** |
283
|
|
|
* {@inheritdoc} |
284
|
|
|
*/ |
285
|
|
|
public function getPoster() { |
286
|
|
|
return $this->get('poster'); |
287
|
|
|
} |
288
|
|
|
|
289
|
|
|
/** |
290
|
|
|
* {@inheritdoc} |
291
|
|
|
*/ |
292
|
|
|
public function getResult() { |
293
|
|
|
return $this->get('result'); |
294
|
|
|
} |
295
|
|
|
|
296
|
|
|
/** |
297
|
|
|
* {@inheritdoc} |
298
|
|
|
*/ |
299
|
|
|
public function getRound() { |
300
|
|
|
return $this->get('round'); |
301
|
|
|
} |
302
|
|
|
|
303
|
|
|
/** |
304
|
|
|
* {@inheritdoc} |
305
|
|
|
*/ |
306
|
|
|
public function getSeason() { |
307
|
|
|
return $this->get('season'); |
308
|
|
|
} |
309
|
|
|
|
310
|
|
|
/** |
311
|
|
|
* {@inheritdoc} |
312
|
|
|
*/ |
313
|
|
|
public function getSpecators() { |
314
|
|
|
return $this->get('specators'); |
315
|
|
|
} |
316
|
|
|
|
317
|
|
|
/** |
318
|
|
|
* {@inheritdoc} |
319
|
|
|
*/ |
320
|
|
|
public function getThumb() { |
321
|
|
|
return $this->get('thumb'); |
322
|
|
|
} |
323
|
|
|
|
324
|
|
|
/** |
325
|
|
|
* {@inheritdoc} |
326
|
|
|
*/ |
327
|
|
|
public function getTime() { |
328
|
|
|
return $this->get('time'); |
329
|
|
|
} |
330
|
|
|
|
331
|
|
|
/** |
332
|
|
|
* {@inheritdoc} |
333
|
|
|
*/ |
334
|
|
|
public function getTvStation() { |
335
|
|
|
return $this->get('tvStation'); |
336
|
|
|
} |
337
|
|
|
} |
338
|
|
|
|