1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace VideoGamesRecords\CoreBundle\Entity; |
4
|
|
|
|
5
|
|
|
use Doctrine\ORM\Mapping as ORM; |
6
|
|
|
|
7
|
|
|
/** |
8
|
|
|
* LostPosition |
9
|
|
|
* |
10
|
|
|
* @ORM\Table(name="vgr_lostposition", indexes={@ORM\Index(name="idxIdPlayer", columns={"idPlayer"}), @ORM\Index(name="idxIdChart", columns={"idChart"})}) |
11
|
|
|
* @ORM\Entity(repositoryClass="VideoGamesRecords\CoreBundle\Repository\LostPositionRepository") |
12
|
|
|
*/ |
13
|
|
|
class LostPosition |
14
|
|
|
{ |
15
|
|
|
/** |
16
|
|
|
* @var integer |
17
|
|
|
* |
18
|
|
|
* @ORM\Column(name="id", type="integer") |
19
|
|
|
* @ORM\Id |
20
|
|
|
* @ORM\GeneratedValue(strategy="IDENTITY") |
21
|
|
|
*/ |
22
|
|
|
private $id; |
23
|
|
|
|
24
|
|
|
/** |
25
|
|
|
* @var integer |
26
|
|
|
* |
27
|
|
|
* @ORM\Column(name="oldRank", type="integer", nullable=false, options={"default":0}) |
28
|
|
|
*/ |
29
|
|
|
private $oldRank; |
30
|
|
|
|
31
|
|
|
/** |
32
|
|
|
* @var integer |
33
|
|
|
* |
34
|
|
|
* @ORM\Column(name="newRank", type="integer", nullable=false, options={"default":0}) |
35
|
|
|
*/ |
36
|
|
|
private $newRank; |
37
|
|
|
|
38
|
|
|
/** |
39
|
|
|
* @var \DateTime |
40
|
|
|
* |
41
|
|
|
* @ORM\Column(name="dateCreation", type="datetime", nullable=false) |
42
|
|
|
*/ |
43
|
|
|
private $dateCreation; |
44
|
|
|
|
45
|
|
|
/** |
46
|
|
|
* @var Player |
47
|
|
|
* |
48
|
|
|
* @ORM\ManyToOne(targetEntity="VideoGamesRecords\CoreBundle\Entity\Player") |
49
|
|
|
* @ORM\JoinColumns({ |
50
|
|
|
* @ORM\JoinColumn(name="idPlayer", referencedColumnName="idPlayer", nullable=false) |
51
|
|
|
* }) |
52
|
|
|
*/ |
53
|
|
|
private $player; |
54
|
|
|
|
55
|
|
|
/** |
56
|
|
|
* @var Chart |
57
|
|
|
* |
58
|
|
|
* @ORM\ManyToOne(targetEntity="VideoGamesRecords\CoreBundle\Entity\Chart") |
59
|
|
|
* @ORM\JoinColumns({ |
60
|
|
|
* @ORM\JoinColumn(name="idChart", referencedColumnName="id", nullable=false) |
61
|
|
|
* }) |
62
|
|
|
*/ |
63
|
|
|
private $chart; |
64
|
|
|
|
65
|
|
|
public function __construct() |
66
|
|
|
{ |
67
|
|
|
$this->setDateCreation(new \DateTime()); |
68
|
|
|
} |
69
|
|
|
|
70
|
|
|
/** |
71
|
|
|
* Set id |
72
|
|
|
* |
73
|
|
|
* @param integer $id |
74
|
|
|
* @return LostPosition |
75
|
|
|
*/ |
76
|
|
|
public function setId($id) |
77
|
|
|
{ |
78
|
|
|
$this->id = $id; |
79
|
|
|
return $this; |
80
|
|
|
} |
81
|
|
|
|
82
|
|
|
/** |
83
|
|
|
* Get id |
84
|
|
|
* |
85
|
|
|
* @return integer |
86
|
|
|
*/ |
87
|
|
|
public function getId() |
88
|
|
|
{ |
89
|
|
|
return $this->id; |
90
|
|
|
} |
91
|
|
|
|
92
|
|
|
/** |
93
|
|
|
* Set newRank |
94
|
|
|
* |
95
|
|
|
* @param integer $newRank |
96
|
|
|
* @return LostPosition |
97
|
|
|
*/ |
98
|
|
|
public function setNewRank($newRank) |
99
|
|
|
{ |
100
|
|
|
$this->newRank = $newRank; |
101
|
|
|
return $this; |
102
|
|
|
} |
103
|
|
|
|
104
|
|
|
/** |
105
|
|
|
* Get newRank |
106
|
|
|
* |
107
|
|
|
* @return integer |
108
|
|
|
*/ |
109
|
|
|
public function getNewRank() |
110
|
|
|
{ |
111
|
|
|
return $this->newRank; |
112
|
|
|
} |
113
|
|
|
|
114
|
|
|
/** |
115
|
|
|
* Set oldRank |
116
|
|
|
* |
117
|
|
|
* @param integer $oldRank |
118
|
|
|
* @return LostPosition |
119
|
|
|
*/ |
120
|
|
|
public function setOldRank($oldRank) |
121
|
|
|
{ |
122
|
|
|
$this->oldRank = $oldRank; |
123
|
|
|
return $this; |
124
|
|
|
} |
125
|
|
|
|
126
|
|
|
/** |
127
|
|
|
* Get oldRank |
128
|
|
|
* |
129
|
|
|
* @return integer |
130
|
|
|
*/ |
131
|
|
|
public function getOldRank() |
132
|
|
|
{ |
133
|
|
|
return $this->oldRank; |
134
|
|
|
} |
135
|
|
|
|
136
|
|
|
/** |
137
|
|
|
* Set dateCreation |
138
|
|
|
* |
139
|
|
|
* @param \DateTime $dateCreation |
140
|
|
|
* @return LostPosition |
141
|
|
|
*/ |
142
|
|
|
public function setDateCreation($dateCreation) |
143
|
|
|
{ |
144
|
|
|
$this->dateCreation = $dateCreation; |
145
|
|
|
|
146
|
|
|
return $this; |
147
|
|
|
} |
148
|
|
|
|
149
|
|
|
/** |
150
|
|
|
* Get dateCreation |
151
|
|
|
* |
152
|
|
|
* @return \DateTime |
153
|
|
|
*/ |
154
|
|
|
public function getDateCreation() |
155
|
|
|
{ |
156
|
|
|
return $this->dateCreation; |
157
|
|
|
} |
158
|
|
|
|
159
|
|
|
/** |
160
|
|
|
* Set chart |
161
|
|
|
* |
162
|
|
|
* @param Chart $chart |
163
|
|
|
* @return LostPosition |
164
|
|
|
*/ |
165
|
|
|
public function setChart(Chart $chart = null) |
166
|
|
|
{ |
167
|
|
|
$this->chart = $chart; |
168
|
|
|
|
169
|
|
|
return $this; |
170
|
|
|
} |
171
|
|
|
|
172
|
|
|
/** |
173
|
|
|
* Get chart |
174
|
|
|
* |
175
|
|
|
* @return Chart |
176
|
|
|
*/ |
177
|
|
|
public function getChart() |
178
|
|
|
{ |
179
|
|
|
return $this->chart; |
180
|
|
|
} |
181
|
|
|
|
182
|
|
|
|
183
|
|
|
/** |
184
|
|
|
* Set player |
185
|
|
|
* |
186
|
|
|
* @param Player $player |
187
|
|
|
* @return LostPosition |
188
|
|
|
*/ |
189
|
|
|
public function setPlayer(Player $player = null) |
190
|
|
|
{ |
191
|
|
|
$this->player = $player; |
192
|
|
|
|
193
|
|
|
return $this; |
194
|
|
|
} |
195
|
|
|
|
196
|
|
|
/** |
197
|
|
|
* Get player |
198
|
|
|
* |
199
|
|
|
* @return Player |
200
|
|
|
*/ |
201
|
|
|
public function getPlayer() |
202
|
|
|
{ |
203
|
|
|
return $this->player; |
204
|
|
|
} |
205
|
|
|
} |
206
|
|
|
|