Completed
Push — master ( 85a7e3...d50bf3 )
by Jelle
02:47
created

EventRepository::nextFiveByTeam()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 3
rs 10
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
/**
3
 * @file
4
 * Contains \TheSportsDb\Entity\Repository\EventRepository.
5
 */
6
7
namespace TheSportsDb\Entity\Repository;
8
9
/**
10
 * The default EventRepository implementation.
11
 *
12
 * @author Jelle Sebreghts
13
 */
14
class EventRepository extends Repository implements EventRepositoryInterface {
15
16
  protected $entityType = 'event';
17
  public function byName($name) {
18
    return $this->normalizeArray($this->sportsDbClient->doRequest('searchevents.php', array('e' => $name))->event);
19
  }
20
21
  public function byFileName($fileName) {
22
    return $this->normalizeArray($this->sportsDbClient->doRequest('searchfilename.php', array('e' => $fileName))->event);
23
  }
24
25
  public function byNameAndSeason($name, $season) {
26
    return $this->normalizeArray($this->sportsDbClient->doRequest('searchevents.php', array('e' => $name, 's' => $season))->event);
27
  }
28
29
  public function nextFiveByTeam($teamId) {
30
    return $this->normalizeArray($this->sportsDbClient->doRequest('eventsnext.php', array('id' => $teamId))->events);
31
  }
32
33
  public function nextFifteenEventsByLeague($leagueId) {
34
    return $this->normalizeArray($this->sportsDbClient->doRequest('eventsnextleague.php', array('id' => $leagueId))->events);
35
  }
36
37
}
38