1 | <?php |
||
18 | class TheSportsDb implements EntityManagerConsumerInterface { |
||
19 | |||
20 | use EntityManagerConsumerTrait; |
||
21 | |||
22 | /** |
||
23 | * Creates a new TheSportsDb instance |
||
24 | */ |
||
25 | public function __construct(EntityManagerInterface $entityManager = NULL) { |
||
30 | |||
31 | /** |
||
32 | * Gets all sports. |
||
33 | * |
||
34 | * @return \TheSportsDb\Entity\SportInterface[] |
||
35 | * The sports. |
||
36 | */ |
||
37 | public function getSports() { |
||
40 | |||
41 | /** |
||
42 | * Get a sport by name. |
||
43 | * |
||
44 | * @param string $name |
||
45 | * The sport name. |
||
46 | * |
||
47 | * @return \TheSportsDb\Entity\SportInterface |
||
48 | * The sport. |
||
49 | */ |
||
50 | public function getSport($name) { |
||
53 | |||
54 | /** |
||
55 | * Gets all leagues. |
||
56 | * |
||
57 | * @return \TheSportsDb\Entity\LeagueInterface[] |
||
58 | * The leagues. |
||
59 | */ |
||
60 | public function getLeagues() { |
||
63 | |||
64 | /** |
||
65 | * Get a league by id. |
||
66 | * |
||
67 | * @param int $leagueId |
||
68 | * The league id. |
||
69 | * |
||
70 | * @return \TheSportsDb\Entity\LeagueInterface |
||
71 | * The league. |
||
72 | */ |
||
73 | public function getLeague($leagueId) { |
||
76 | |||
77 | /** |
||
78 | * Gets all leagues by country. |
||
79 | * |
||
80 | * @param string $country |
||
81 | * The country of which to get the leagues. |
||
82 | * |
||
83 | * @return \TheSportsDb\Entity\LeagueInterface[] |
||
84 | * The leagues. |
||
85 | */ |
||
86 | public function getLeaguesByCountry($country) { |
||
89 | |||
90 | /** |
||
91 | * Gets all leagues by sport. |
||
92 | * |
||
93 | * @param mixed $sport |
||
94 | * The sport of which to get the leagues. |
||
95 | * |
||
96 | * @return \TheSportsDb\Entity\LeagueInterface[] |
||
97 | * The leagues. |
||
98 | */ |
||
99 | public function getLeaguesBySport($sport) { |
||
102 | |||
103 | /** |
||
104 | * Gets all leagues by country and sport. |
||
105 | * |
||
106 | * @param string $country |
||
107 | * The country of which to get the leagues. |
||
108 | * @param mixed $sport |
||
109 | * The sport of which to get the leagues. |
||
110 | * |
||
111 | * @return \TheSportsDb\Entity\LeagueInterface[] |
||
112 | * The leagues. |
||
113 | */ |
||
114 | public function getLeaguesByCountryAndSport($country, $sport) { |
||
117 | |||
118 | /** |
||
119 | * Gets a team by id. |
||
120 | * |
||
121 | * @param mixed $teamId |
||
122 | * The team id. |
||
123 | * |
||
124 | * @return \TheSportsDb\Entity\TeamInterface |
||
125 | * The team. |
||
126 | */ |
||
127 | public function getTeam($teamId) { |
||
130 | |||
131 | /** |
||
132 | * Gets a team by name. |
||
133 | * |
||
134 | * @param string $teamName |
||
135 | * The team name. |
||
136 | * |
||
137 | * @return \TheSportsDb\Entity\TeamInterface[] |
||
138 | * The team. |
||
139 | */ |
||
140 | public function getTeamsByName($teamName) { |
||
141 | return $this->entityManager->repository('team')->byName($teamName); |
||
142 | } |
||
143 | |||
144 | /** |
||
145 | * Gets a teams by league id. |
||
146 | * |
||
147 | * @param mixed $leagueId |
||
148 | * The league id. |
||
149 | * |
||
150 | * @return \TheSportsDb\Entity\TeamInterface[] |
||
151 | * The teams. |
||
152 | */ |
||
153 | public function getTeamsByLeague($leagueId) { |
||
156 | |||
157 | /** |
||
158 | * Gets a teams by league name. |
||
159 | * |
||
160 | * @param string $leagueName |
||
161 | * The league name. |
||
162 | * |
||
163 | * @return \TheSportsDb\Entity\TeamInterface[] |
||
164 | * The teams. |
||
165 | */ |
||
166 | public function getTeamsByLeagueName($leagueName) { |
||
169 | |||
170 | /** |
||
171 | * Gets a teams by sport and country. |
||
172 | * |
||
173 | * @param mixed $sport |
||
174 | * The sport. |
||
175 | * @param string $country |
||
176 | * The country. |
||
177 | * |
||
178 | * @return \TheSportsDb\Entity\TeamInterface[] |
||
179 | * The teams. |
||
180 | */ |
||
181 | public function getTeamsBySportAndCountry($sport, $country) { |
||
184 | |||
185 | /** |
||
186 | * Get a player by id. |
||
187 | * |
||
188 | * @param mixed $playerId |
||
189 | * The player id. |
||
190 | * |
||
191 | * @return \TheSportsDb\Entity\PlayerInterface |
||
192 | * The player. |
||
193 | */ |
||
194 | public function getPlayer($playerId) { |
||
197 | |||
198 | /** |
||
199 | * Get a players by team id. |
||
200 | * |
||
201 | * @param mixed $teamId |
||
202 | * The team id. |
||
203 | * |
||
204 | * @return \TheSportsDb\Entity\PlayerInterface[] |
||
205 | * The players. |
||
206 | */ |
||
207 | public function getPlayersByTeam($teamId) { |
||
210 | |||
211 | /** |
||
212 | * Get a players by team name. |
||
213 | * |
||
214 | * @param mixed $teamName |
||
215 | * The team name. |
||
216 | * |
||
217 | * @return \TheSportsDb\Entity\PlayerInterface[] |
||
218 | * The players. |
||
219 | */ |
||
220 | public function getPlayersByTeamName($teamName) { |
||
223 | |||
224 | /** |
||
225 | * Get a players by name. |
||
226 | * |
||
227 | * @param mixed $name |
||
228 | * The name. |
||
229 | * |
||
230 | * @return \TheSportsDb\Entity\PlayerInterface[] |
||
231 | * The players. |
||
232 | */ |
||
233 | public function getPlayersByName($name) { |
||
236 | |||
237 | /** |
||
238 | * Get a players by team and name. |
||
239 | * |
||
240 | * @param string $teamName |
||
241 | * The team name. |
||
242 | * @param string $name |
||
243 | * The name. |
||
244 | * |
||
245 | * @return \TheSportsDb\Entity\PlayerInterface[] |
||
246 | * The players. |
||
247 | */ |
||
248 | public function getPlayersByTeamNameAndName($teamName, $name) { |
||
251 | |||
252 | /** |
||
253 | * Get an event by id. |
||
254 | * |
||
255 | * @param mixed $eventId |
||
256 | * The event id. |
||
257 | * |
||
258 | * @return \TheSportsDb\Entity\EventInterface |
||
259 | * The event. |
||
260 | */ |
||
261 | public function getEvent($eventId) { |
||
264 | |||
265 | /** |
||
266 | * Get events by name. |
||
267 | * |
||
268 | * @param string $name |
||
269 | * The event name. |
||
270 | * |
||
271 | * @return \TheSportsDb\Entity\EventInterface[] |
||
272 | * The events. |
||
273 | */ |
||
274 | public function getEventsByName($name) { |
||
277 | |||
278 | /** |
||
279 | * Get events by file name. |
||
280 | * |
||
281 | * @param string $name |
||
282 | * The file name. |
||
283 | * |
||
284 | * @return \TheSportsDb\Entity\EventInterface[] |
||
285 | * The events. |
||
286 | */ |
||
287 | public function getEventsByFileName($name) { |
||
290 | |||
291 | /** |
||
292 | * Get events by name and season. |
||
293 | * |
||
294 | * @param string $name |
||
295 | * The event name. |
||
296 | * @param mixed $season |
||
297 | * The season. |
||
298 | * |
||
299 | * @return \TheSportsDb\Entity\EventInterface[] |
||
300 | * The events. |
||
301 | */ |
||
302 | public function getEventsByNameAndSeason($name, $season) { |
||
305 | |||
306 | /** |
||
307 | * Get next five events by team. |
||
308 | * |
||
309 | * @param mixed $teamId |
||
310 | * The team id. |
||
311 | * |
||
312 | * @return \TheSportsDb\Entity\EventInterface[] |
||
313 | * The events. |
||
314 | */ |
||
315 | public function getNextFiveEventsByTeam($teamId) { |
||
318 | |||
319 | /** |
||
320 | * Get next fifteen events by league. |
||
321 | * |
||
322 | * @param mixed $leagueId |
||
323 | * The league id. |
||
324 | * |
||
325 | * @return \TheSportsDb\Entity\EventInterface[] |
||
326 | * The events. |
||
327 | */ |
||
328 | public function getNextFifteenEventsByLeague($leagueId) { |
||
331 | |||
332 | /** |
||
333 | * Get next fifteen events by league and round. |
||
334 | * |
||
335 | * @param mixed $leagueId |
||
336 | * The league id. |
||
337 | * @param int $round |
||
338 | * The round. |
||
339 | * |
||
340 | * @return \TheSportsDb\Entity\EventInterface[] |
||
341 | * The events. |
||
342 | */ |
||
343 | public function getNextFifteenEventsByLeagueAndRound($leagueId, $round) { |
||
346 | |||
347 | /** |
||
348 | * Get last five events by team. |
||
349 | * |
||
350 | * @param mixed $teamId |
||
351 | * The team id. |
||
352 | * |
||
353 | * @return \TheSportsDb\Entity\EventInterface[] |
||
354 | * The events. |
||
355 | */ |
||
356 | public function getLastFiveEventsByTeam($teamId) { |
||
359 | |||
360 | /** |
||
361 | * Get last fifteen events by league. |
||
362 | * |
||
363 | * @param mixed $leagueId |
||
364 | * The league id. |
||
365 | * |
||
366 | * @return \TheSportsDb\Entity\EventInterface[] |
||
367 | * The events. |
||
368 | */ |
||
369 | public function getLastFifteenEventsByLeague($leagueId) { |
||
372 | |||
373 | /** |
||
374 | * Get events by day. |
||
375 | * |
||
376 | * @param \DateTime $date |
||
377 | * The day. |
||
378 | * @param string|null $sport |
||
379 | * The sport. |
||
380 | * @param string|null $leagueName |
||
381 | * The league name. |
||
382 | * |
||
383 | * @return \TheSportsDb\Entity\EventInterface[] |
||
384 | * The events. |
||
385 | */ |
||
386 | public function getEventsByDay(\DateTime $date, $sport = NULL, $leagueName = NULL) { |
||
389 | |||
390 | /** |
||
391 | * Get events by league, round and season. |
||
392 | * |
||
393 | * @param mixed $leagueId |
||
394 | * The league id. |
||
395 | * @param int $round |
||
396 | * The round. |
||
397 | * @param mixed $season |
||
398 | * The season. |
||
399 | * |
||
400 | * @return \TheSportsDb\Entity\EventInterface[] |
||
401 | * The events. |
||
402 | */ |
||
403 | public function getEventsByLeagueRoundAndSeason($leagueId, $round, $season) { |
||
406 | |||
407 | /** |
||
408 | * Get events by league and season. |
||
409 | * |
||
410 | * @param mixed $leagueId |
||
411 | * The league id. |
||
412 | * @param mixed $season |
||
413 | * The season. |
||
414 | * |
||
415 | * @return \TheSportsDb\Entity\EventInterface[] |
||
416 | * The events. |
||
417 | */ |
||
418 | public function getEventsByLeagueAndSeason($leagueId, $season) { |
||
421 | |||
422 | /** |
||
423 | * Get seasons by league. |
||
424 | * |
||
425 | * @param mixed $leagueId |
||
426 | * The league id. |
||
427 | * |
||
428 | * @return \TheSportsDb\Entity\SeasonInterface[] |
||
429 | * The seasons. |
||
430 | */ |
||
431 | public function getSeasonsByLeague($leagueId) { |
||
434 | } |
||
435 |