Completed
Pull Request — master (#112)
by De Cramer
11:22
created

Record::getCheckpointTimes()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 2
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php
2
3
namespace eXpansion\Bundle\LocalRecords\Entity;
4
5
use eXpansion\Framework\PlayersBundle\Entity\Player;
6
7
/**
8
 * Class Record
9
 *
10
 * @package eXpansion\Bundle\LocalRecords;
11
 * @author  oliver de Cramer <[email protected]>
12
 */
13
class Record
14
{
15
    /** @var int */
16
    protected $id;
17
18
    /** @var string */
19
    protected $mapUid;
20
21
    /** @var Player */
22
    protected $player;
23
24
    /** @var int */
25
    protected $nbLaps;
26
27
    /** @var int */
28
    protected $score;
29
30
    /** @var int */
31
    protected $nbFinish;
32
33
    /** @var int */
34
    protected $avgScore;
35
36
    /** @var string */
37
    protected $checkpoints;
38
39
    /** @var  \DateTime */
40
    protected $date;
41
42
    /**
43
     * @return int
44
     */
45
    public function getId()
46
    {
47
        return $this->id;
48
    }
49
50
    /**
51
     * @param int $id
52
     */
53
    public function setId($id)
54
    {
55
        $this->id = $id;
56
    }
57
58
    /**
59
     * @return string
60
     */
61
    public function getMapUid()
62
    {
63
        return $this->mapUid;
64
    }
65
66
    /**
67
     * @param string $mapUid
68
     */
69 6
    public function setMapUid($mapUid)
70
    {
71 6
        $this->mapUid = $mapUid;
72 6
    }
73
74
    /**
75
     * @return Player
76
     */
77 27
    public function getPlayer()
78
    {
79 27
        return $this->player;
80
    }
81
82
    /**
83
     * @param Player $player
84
     */
85 28
    public function setPlayer(Player $player)
86
    {
87 28
        $this->player = $player;
88 28
    }
89
90
    /**
91
     * @return int
92
     */
93
    public function getNbLaps()
94
    {
95
        return $this->nbLaps;
96
    }
97
98
    /**
99
     * @param int $nbLaps
100
     */
101 6
    public function setNbLaps($nbLaps)
102
    {
103 6
        $this->nbLaps = $nbLaps;
104 6
    }
105
106
    /**
107
     * @return int
108
     */
109 27
    public function getScore()
110
    {
111 27
        return $this->score;
112
    }
113
114
    /**
115
     * @param int $score
116
     */
117 28
    public function setScore($score)
118
    {
119 28
        $this->score = $score;
120 28
    }
121
122
    /**
123
     * @return int
124
     */
125 12
    public function getNbFinish()
126
    {
127 12
        return $this->nbFinish;
128
    }
129
130
    /**
131
     * @param int $nbFinish
132
     */
133 12
    public function setNbFinish($nbFinish)
134
    {
135 12
        $this->nbFinish = $nbFinish;
136 12
    }
137
138
    /**
139
     * @return int
140
     */
141 12
    public function getAvgScore()
142
    {
143 12
        return $this->avgScore;
144
    }
145
146
    /**
147
     * @param int $avgScore
148
     */
149 12
    public function setAvgScore($avgScore)
150
    {
151 12
        $this->avgScore = $avgScore;
152 12
    }
153
154
    /**
155
     * @return string
156
     */
157
    public function getCheckpoints()
158
    {
159
        return $this->checkpoints;
160
    }
161
162
    /**
163
     * @param string $checkpoints
164
     */
165 10
    public function setCheckpoints($checkpoints)
166
    {
167 10
        $this->checkpoints = $checkpoints;
168 10
    }
169
170
    /**
171
     * Get checkpoint times
172
     *
173
     * @return int[]
174
     */
175
    public function getCheckpointTimes()
176
    {
177
        return explode(',', $this->getCheckpoints());
178
    }
179
180
    /**
181
     * Set checkpoint times.
182
     *
183
     * @param int[]
184
     */
185 10
    public function setCheckpointTimes($checkpointTimes)
186
    {
187 10
            $this->setCheckpoints(implode(',', $checkpointTimes));
188 10
    }
189
190
    /**
191
     * @return \DateTime
192
     */
193
    public function getDate()
194
    {
195
        return $this->date;
196
    }
197
198
    /**
199
     * @param \DateTime $date
200
     */
201 10
    public function setDate($date)
202
    {
203 10
        $this->date = $date;
204
    }
205
}