Passed
Push — develop ( 574080...0f5d99 )
by BENARD
04:30
created

PlayerGame::setPointChart()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 2
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
nc 1
nop 1
1
<?php
2
3
namespace VideoGamesRecords\CoreBundle\Entity;
4
5
use ApiPlatform\Core\Annotation\ApiFilter;
6
use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\OrderFilter;
7
use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\SearchFilter;
8
use ApiPlatform\Core\Serializer\Filter\GroupFilter;
9
use DateTime;
10
use Doctrine\ORM\Mapping as ORM;
11
use VideoGamesRecords\CoreBundle\Model\Entity\NbChartProvenTrait;
12
use VideoGamesRecords\CoreBundle\Model\Entity\NbChartProvenWithoutDlcTrait;
13
use VideoGamesRecords\CoreBundle\Model\Entity\NbChartTrait;
14
use VideoGamesRecords\CoreBundle\Model\Entity\NbChartWithoutDlcTrait;
15
use VideoGamesRecords\CoreBundle\Model\Entity\NbEqualTrait;
16
17
/**
18
 * PlayerGame
19
 *
20
 * @ORM\Table(name="vgr_player_game")
21
 * @ORM\Entity(repositoryClass="VideoGamesRecords\CoreBundle\Repository\PlayerGameRepository")
22
 * @ApiFilter(
23
 *     SearchFilter::class,
24
 *     properties={
25
 *          "player": "exact",
26
 *          "game": "exact",
27
 *          "game.platforms": "exact",
28
 *          "game.badge": "exact",
29
 *     }
30
 * )
31
 * @ApiFilter(
32
 *     GroupFilter::class,
33
 *     arguments={
34
 *          "parameterName": "groups",
35
 *          "overrideDefaultGroups": true,
36
 *          "whitelist": {
37
 *              "game.read.mini",
38
 *              "game.platforms",
39
 *              "platform.read",
40
 *              "playerGame.game",
41
 *              "playerGame.pointChart",
42
 *              "playerGame.medal",
43
 *              "playerGame.proof",
44
 *              "game.stats",
45
 *          }
46
 *      }
47
 * )
48
 * @ApiFilter(
49
 *     OrderFilter::class,
50
 *     properties={
51
 *          "rankPointChart": "ASC",
52
 *          "chartRank0": "DESC",
53
 *          "chartRank1": "DESC",
54
 *          "chartRank2": "DESC",
55
 *          "chartRank3": "DESC",
56
 *          "pointGame": "DESC",
57
 *          "nbChart": "DESC",
58
 *          "nbEqual": "ASC",
59
 *          "game.nbPlayer" : "DESC",
60
 *          "game.libGameEn" : "ASC",
61
 *          "game.libGameFr" : "ASC",
62
 *     },
63
 *     arguments={"orderParameterName"="order"}
64
 * )
65
 */
66
class PlayerGame
67
{
68
    use NbChartTrait;
69
    use NbChartWithoutDlcTrait;
70
    use NbChartProvenTrait;
71
    use NbChartProvenWithoutDlcTrait;
72
    use NbEqualTrait;
73
74
    /**
75
     * @ORM\Id
76
     * @ORM\ManyToOne(targetEntity="VideoGamesRecords\CoreBundle\Entity\Player")
77
     * @ORM\JoinColumns({
78
     *   @ORM\JoinColumn(name="idPlayer", referencedColumnName="id", nullable=false, onDelete="CASCADE")
79
     * })
80
     */
81
    private Player $player;
82
83
    /**
84
     * @ORM\Id
85
     * @ORM\ManyToOne(targetEntity="VideoGamesRecords\CoreBundle\Entity\Game", fetch="EAGER")
86
     * @ORM\JoinColumns({
87
     *   @ORM\JoinColumn(name="idGame", referencedColumnName="id", nullable=false, onDelete="CASCADE")
88
     * })
89
     */
90
    private Game $game;
91
92
    /**
93
     * @ORM\Column(name="rankPointChart", type="integer", nullable=false)
94
     */
95
    private int $rankPointChart = 0;
96
97
    /**
98
     * @ORM\Column(name="rankMedal", type="integer", nullable=false)
99
     */
100
    private int $rankMedal = 0;
101
102
    /**
103
     * @var integer
104
     *
105
     * @ORM\Column(name="chartRank0", type="integer", nullable=false)
106
     */
107
    private int $chartRank0 = 0;
108
109
    /**
110
     * @ORM\Column(name="chartRank1", type="integer", nullable=false)
111
     */
112
    private int $chartRank1 = 0;
113
114
    /**
115
     * @ORM\Column(name="chartRank2", type="integer", nullable=false)
116
     */
117
    private int $chartRank2 = 0;
118
119
    /**
120
     * @ORM\Column(name="chartRank3", type="integer", nullable=false)
121
     */
122
    private int $chartRank3 = 0;
123
124
    /**
125
     * @ORM\Column(name="chartRank4", type="integer", nullable=false)
126
     */
127
    private int $chartRank4 = 0;
128
129
    /**
130
     * @ORM\Column(name="chartRank5", type="integer", nullable=false)
131
     */
132
    private int $chartRank5 = 0;
133
134
    /**
135
     * @ORM\Column(name="pointChart", type="integer", nullable=false)
136
     */
137
    private int $pointChart = 0;
138
139
    /**
140
     * @var integer
141
     *
142
     * @ORM\Column(name="pointChartWithoutDlc", type="integer", nullable=false)
143
     */
144
    private int $pointChartWithoutDlc = 0;
145
146
    /**
147
     * @ORM\Column(name="pointGame", type="integer", nullable=false)
148
     */
149
    private int $pointGame = 0;
150
151
    /**
152
     * @ORM\Column(name="lastUpdate", type="datetime", nullable=false)
153
     */
154
    private DateTime $lastUpdate;
155
156
157
    private $statuses;
158
159
    /**
160
     * Set rankPointChart
161
     * @param integer $rankPointChart
162
     * @return $this
163
     */
164
    public function setRankPointChart(int $rankPointChart): Self
165
    {
166
        $this->rankPointChart = $rankPointChart;
167
        return $this;
168
    }
169
170
    /**
171
     * Get rankPointChart
172
     *
173
     * @return integer
174
     */
175
    public function getRankPointChart(): int
176
    {
177
        return $this->rankPointChart;
178
    }
179
180
181
    /**
182
     * Set rankMedal
183
     * @param integer $rankMedal
184
     * @return $this
185
     */
186
    public function setRankMedal(int $rankMedal): Self
187
    {
188
        $this->rankMedal = $rankMedal;
189
        return $this;
190
    }
191
192
    /**
193
     * Get rankMedal
194
     *
195
     * @return integer
196
     */
197
    public function getRankMedal(): int
198
    {
199
        return $this->rankMedal;
200
    }
201
202
    /**
203
     * Set chartRank0
204
     * @param integer $chartRank0
205
     * @return $this
206
     */
207
    public function setChartRank0(int $chartRank0): Self
208
    {
209
        $this->chartRank0 = $chartRank0;
210
        return $this;
211
    }
212
213
    /**
214
     * Get chartRank0
215
     *
216
     * @return integer
217
     */
218
    public function getChartRank0(): int
219
    {
220
        return $this->chartRank0;
221
    }
222
223
    /**
224
     * Set chartRank1
225
     * @param integer $chartRank1
226
     * @return $this
227
     */
228
    public function setChartRank1(int $chartRank1): Self
229
    {
230
        $this->chartRank1 = $chartRank1;
231
        return $this;
232
    }
233
234
    /**
235
     * Get chartRank1
236
     *
237
     * @return integer
238
     */
239
    public function getChartRank1(): int
240
    {
241
        return $this->chartRank1;
242
    }
243
244
    /**
245
     * Set chartRank2
246
     * @param integer $chartRank2
247
     * @return $this
248
     */
249
    public function setChartRank2(int $chartRank2): Self
250
    {
251
        $this->chartRank2 = $chartRank2;
252
        return $this;
253
    }
254
255
    /**
256
     * Get chartRank2
257
     *
258
     * @return integer
259
     */
260
    public function getChartRank2(): int
261
    {
262
        return $this->chartRank2;
263
    }
264
265
    /**
266
     * Set chartRank3
267
     * @param integer $chartRank3
268
     * @return $this
269
     */
270
    public function setChartRank3(int $chartRank3): Self
271
    {
272
        $this->chartRank3 = $chartRank3;
273
        return $this;
274
    }
275
276
    /**
277
     * Get chartRank3
278
     *
279
     * @return integer
280
     */
281
    public function getChartRank3(): int
282
    {
283
        return $this->chartRank3;
284
    }
285
286
    /**
287
     * Set chartRank4
288
     * @param integer $chartRank4
289
     * @return $this
290
     */
291
    public function setChartRank4(int $chartRank4): Self
292
    {
293
        $this->chartRank4 = $chartRank4;
294
        return $this;
295
    }
296
297
    /**
298
     * Get chartRank4
299
     *
300
     * @return integer
301
     */
302
    public function getChartRank4(): int
303
    {
304
        return $this->chartRank4;
305
    }
306
307
    /**
308
     * Set chartRank5
309
     * @param integer $chartRank5
310
     * @return $this
311
     */
312
    public function setChartRank5(int $chartRank5): Self
313
    {
314
        $this->chartRank5 = $chartRank5;
315
        return $this;
316
    }
317
318
    /**
319
     * Get chartRank5
320
     *
321
     * @return integer
322
     */
323
    public function getChartRank5(): int
324
    {
325
        return $this->chartRank5;
326
    }
327
328
    /**
329
     * Set pointChart
330
     * @param integer $pointChart
331
     * @return $this
332
     */
333
    public function setPointChart(int $pointChart): Self
334
    {
335
        $this->pointChart = $pointChart;
336
        return $this;
337
    }
338
339
    /**
340
     * Get pointChart
341
     *
342
     * @return integer
343
     */
344
    public function getPointChart(): int
345
    {
346
        return $this->pointChart;
347
    }
348
349
    /**
350
     * Set pointChartWithoutDlc
351
     * @param integer $pointChartWithoutDlc
352
     * @return $this
353
     */
354
    public function setPointChartWithoutDlc(int $pointChartWithoutDlc): Self
355
    {
356
        $this->pointChartWithoutDlc = $pointChartWithoutDlc;
357
        return $this;
358
    }
359
360
    /**
361
     * Get pointChartWithoutDlc
362
     *
363
     * @return integer
364
     */
365
    public function getPointChartWithoutDlc(): int
366
    {
367
        return $this->pointChartWithoutDlc;
368
    }
369
370
371
    /**
372
     * Set pointGame
373
     * @param integer $pointGame
374
     * @return $this
375
     */
376
    public function setPointGame(int $pointGame): Self
377
    {
378
        $this->pointGame = $pointGame;
379
        return $this;
380
    }
381
382
    /**
383
     * Get pointGame
384
     *
385
     * @return integer
386
     */
387
    public function getPointGame(): int
388
    {
389
        return $this->pointGame;
390
    }
391
392
    /**
393
     * Set game
394
     * @param Game $game
395
     * @return $this
396
     */
397
    public function setGame(Game $game): Self
398
    {
399
        $this->game = $game;
400
401
        return $this;
402
    }
403
404
    /**
405
     * Set lastUpdate
406
     * @param DateTime $lastUpdate
407
     * @return $this
408
     */
409
    public function setLastUpdate(DateTime $lastUpdate): Self
410
    {
411
        $this->lastUpdate = $lastUpdate;
412
413
        return $this;
414
    }
415
416
    /**
417
     * Get lastUpdate
418
     *
419
     * @return DateTime
420
     */
421
    public function getLastUpdate(): DateTime
422
    {
423
        return $this->lastUpdate;
424
    }
425
426
    /**
427
     * Get game
428
     *
429
     * @return Game
430
     */
431
    public function getGame(): Game
432
    {
433
        return $this->game;
434
    }
435
436
437
    /**
438
     * Set player
439
     * @param Player $player
440
     * @return $this
441
     */
442
    public function setPlayer(Player $player): Self
443
    {
444
        $this->player = $player;
445
446
        return $this;
447
    }
448
449
    /**
450
     * Get player
451
     *
452
     * @return Player
453
     */
454
    public function getPlayer(): Player
455
    {
456
        return $this->player;
457
    }
458
459
    /**
460
     * @param $statuses
461
     */
462
    public function setStatuses($statuses)
463
    {
464
        $this->statuses = $statuses;
465
    }
466
467
    /**
468
     * @return mixed
469
     */
470
    public function getStatuses()
471
    {
472
        return $this->statuses;
473
    }
474
}
475