Completed
Push — master ( ad4118...2bb684 )
by Jelle
10:14 queued 04:02
created

PlayerProxy   A

Complexity

Total Complexity 25

Size/Duplication

Total Lines 175
Duplicated Lines 0 %

Coupling/Cohesion

Components 2
Dependencies 3

Test Coverage

Coverage 88.46%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 25
lcom 2
cbo 3
dl 0
loc 175
ccs 46
cts 52
cp 0.8846
rs 10
c 1
b 0
f 0

24 Methods

Rating   Name   Duplication   Size   Complexity  
A load() 0 8 2
A getId() 0 3 1
A getTeam() 0 3 1
A getNationality() 0 3 1
A getName() 0 3 1
A getSport() 0 3 1
A getBirthDay() 0 3 1
A getDateSigned() 0 3 1
A getSigning() 0 3 1
A getWage() 0 3 1
A getBirthLocation() 0 3 1
A getDescription() 0 3 1
A getGender() 0 3 1
A getPosition() 0 3 1
A getFacebook() 0 3 1
A getWebsite() 0 3 1
A getTwitter() 0 3 1
A getInstagram() 0 3 1
A getYoutube() 0 3 1
A getHeight() 0 3 1
A getWeight() 0 3 1
A getThumb() 0 3 1
A getCutout() 0 3 1
A getLocked() 0 3 1
1
<?php
2
/**
3
 * @file
4
 * Contains \TheSportsDb\Entity\Proxy\Player.
5
 */
6
7
namespace TheSportsDb\Entity\Proxy;
8
9
use TheSportsDb\Entity\PlayerInterface;
10
11
/**
12
 * A fully loaded player object.
13
 *
14
 * @author Jelle Sebreghts
15
 */
16
class PlayerProxy extends Proxy implements PlayerInterface {
17
18
  /**
19
   * {@inheritdoc}
20
   */
21
  protected function load() {
22
    $playerData = $this->sportsDbClient->doRequest('lookupplayer.php', array('id' => $this->properties->id));
23
    if (isset($playerData->players)) {
24
      $this->update($this->entityManager->mapProperties(reset($playerData->players), $this->getEntityType()));
25
      return;
26
    }
27
    throw new \Exception('Could not fully load player with id ' . $this->properties->id . '.');
28
  }
29
30
  /**
31
   * {@inheritdoc}
32
   */
33 1
  public function getId() {
34 1
    return $this->get('id');
35
  }
36
37
  /**
38
   * {@inheritdoc}
39
   */
40 1
  public function getTeam() {
41 1
    return $this->get('team');
42
  }
43
44
  /**
45
   * {@inheritdoc}
46
   */
47 1
  public function getNationality() {
48 1
    return $this->get('nationality');
49
  }
50
51
  /**
52
   * {@inheritdoc}
53
   */
54 1
  public function getName() {
55 1
    return $this->get('name');
56
  }
57
58
  /**
59
   * {@inheritdoc}
60
   */
61 1
  public function getSport() {
62 1
    return $this->get('sport');
63
  }
64
65
  /**
66
   * {@inheritdoc}
67
   */
68 1
  public function getBirthDay() {
69 1
    return $this->get('birthDay');
70
  }
71
72
  /**
73
   * {@inheritdoc}
74
   */
75 1
  public function getDateSigned() {
76 1
    return $this->get('dateSigned');
77
  }
78
79
  /**
80
   * {@inheritdoc}
81
   */
82 1
  public function getSigning() {
83 1
    return $this->get('signing');
84
  }
85
86
  /**
87
   * {@inheritdoc}
88
   */
89 1
  public function getWage() {
90 1
    return $this->get('wage');
91
  }
92
93
  /**
94
   * {@inheritdoc}
95
   */
96 1
  public function getBirthLocation() {
97 1
    return $this->get('birthLocation');
98
  }
99
100
  /**
101
   * {@inheritdoc}
102
   */
103 1
  public function getDescription() {
104 1
    return $this->get('description');
105
  }
106
107
  /**
108
   * {@inheritdoc}
109
   */
110 1
  public function getGender() {
111 1
    return $this->get('gender');
112
  }
113
114
  /**
115
   * {@inheritdoc}
116
   */
117 1
  public function getPosition() {
118 1
    return $this->get('position');
119
  }
120
121
  /**
122
   * {@inheritdoc}
123
   */
124 1
  public function getFacebook() {
125 1
    return $this->get('facebook');
126
  }
127
128
  /**
129
   * {@inheritdoc}
130
   */
131 1
  public function getWebsite() {
132 1
    return $this->get('website');
133
  }
134
135
  /**
136
   * {@inheritdoc}
137
   */
138 1
  public function getTwitter() {
139 1
    return $this->get('twitter');
140
  }
141
142
  /**
143
   * {@inheritdoc}
144
   */
145 1
  public function getInstagram() {
146 1
    return $this->get('instagram');
147
  }
148
149
  /**
150
   * {@inheritdoc}
151
   */
152 1
  public function getYoutube() {
153 1
    return $this->get('youtube');
154
  }
155
156
  /**
157
   * {@inheritdoc}
158
   */
159 1
  public function getHeight() {
160 1
    return $this->get('height');
161
  }
162
163
  /**
164
   * {@inheritdoc}
165
   */
166 1
  public function getWeight() {
167 1
    return $this->get('weight');
168
  }
169
170
  /**
171
   * {@inheritdoc}
172
   */
173 1
  public function getThumb() {
174 1
    return $this->get('thumb');
175
  }
176
177
  /**
178
   * {@inheritdoc}
179
   */
180 1
  public function getCutout() {
181 1
    return $this->get('cutout');
182
  }
183
184
  /**
185
   * {@inheritdoc}
186
   */
187 1
  public function getLocked() {
188 1
    return $this->get('locked');
189
  }
190
}
191