Passed
Push — develop ( 0f5d99...ddb92e )
by BENARD
04:38
created

PlayerGame::setChartRank2()   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\Game\GameMethodsTrait;
12
use VideoGamesRecords\CoreBundle\Model\Entity\NbChartProvenTrait;
13
use VideoGamesRecords\CoreBundle\Model\Entity\NbChartProvenWithoutDlcTrait;
14
use VideoGamesRecords\CoreBundle\Model\Entity\NbChartTrait;
15
use VideoGamesRecords\CoreBundle\Model\Entity\NbChartWithoutDlcTrait;
16
use VideoGamesRecords\CoreBundle\Model\Entity\NbEqualTrait;
17
use VideoGamesRecords\CoreBundle\Model\Entity\Player\PlayerMethodsTrait;
18
use VideoGamesRecords\CoreBundle\Model\Entity\RankMedalTrait;
19
use VideoGamesRecords\CoreBundle\Model\Entity\RankPointChartTrait;
20
21
/**
22
 * PlayerGame
23
 *
24
 * @ORM\Table(name="vgr_player_game")
25
 * @ORM\Entity(repositoryClass="VideoGamesRecords\CoreBundle\Repository\PlayerGameRepository")
26
 * @ApiFilter(
27
 *     SearchFilter::class,
28
 *     properties={
29
 *          "player": "exact",
30
 *          "game": "exact",
31
 *          "game.platforms": "exact",
32
 *          "game.badge": "exact",
33
 *     }
34
 * )
35
 * @ApiFilter(
36
 *     GroupFilter::class,
37
 *     arguments={
38
 *          "parameterName": "groups",
39
 *          "overrideDefaultGroups": true,
40
 *          "whitelist": {
41
 *              "game.read.mini",
42
 *              "game.platforms",
43
 *              "platform.read",
44
 *              "playerGame.game",
45
 *              "playerGame.pointChart",
46
 *              "playerGame.medal",
47
 *              "playerGame.proof",
48
 *              "game.stats",
49
 *          }
50
 *      }
51
 * )
52
 * @ApiFilter(
53
 *     OrderFilter::class,
54
 *     properties={
55
 *          "rankPointChart": "ASC",
56
 *          "chartRank0": "DESC",
57
 *          "chartRank1": "DESC",
58
 *          "chartRank2": "DESC",
59
 *          "chartRank3": "DESC",
60
 *          "pointGame": "DESC",
61
 *          "nbChart": "DESC",
62
 *          "nbEqual": "ASC",
63
 *          "game.nbPlayer" : "DESC",
64
 *          "game.libGameEn" : "ASC",
65
 *          "game.libGameFr" : "ASC",
66
 *     },
67
 *     arguments={"orderParameterName"="order"}
68
 * )
69
 */
70
class PlayerGame
71
{
72
    use NbChartTrait;
73
    use NbChartWithoutDlcTrait;
74
    use NbChartProvenTrait;
75
    use NbChartProvenWithoutDlcTrait;
76
    use NbEqualTrait;
77
    use RankMedalTrait;
78
    use RankPointChartTrait;
79
    use PlayerMethodsTrait;
80
    use GameMethodsTrait;
81
82
    /**
83
     * @ORM\Id
84
     * @ORM\ManyToOne(targetEntity="VideoGamesRecords\CoreBundle\Entity\Player")
85
     * @ORM\JoinColumns({
86
     *   @ORM\JoinColumn(name="idPlayer", referencedColumnName="id", nullable=false, onDelete="CASCADE")
87
     * })
88
     */
89
    private Player $player;
0 ignored issues
show
introduced by
The private property $player is not used, and could be removed.
Loading history...
90
91
    /**
92
     * @ORM\Id
93
     * @ORM\ManyToOne(targetEntity="VideoGamesRecords\CoreBundle\Entity\Game", fetch="EAGER")
94
     * @ORM\JoinColumns({
95
     *   @ORM\JoinColumn(name="idGame", referencedColumnName="id", nullable=false, onDelete="CASCADE")
96
     * })
97
     */
98
    private Game $game;
0 ignored issues
show
introduced by
The private property $game is not used, and could be removed.
Loading history...
99
100
    /**
101
     * @var integer
102
     *
103
     * @ORM\Column(name="pointChartWithoutDlc", type="integer", nullable=false)
104
     */
105
    private int $pointChartWithoutDlc = 0;
106
107
    /**
108
     * @ORM\Column(name="pointGame", type="integer", nullable=false)
109
     */
110
    private int $pointGame = 0;
111
112
    /**
113
     * @ORM\Column(name="lastUpdate", type="datetime", nullable=false)
114
     */
115
    private DateTime $lastUpdate;
116
117
118
    private $statuses;
119
120
121
    /**
122
     * Set pointChartWithoutDlc
123
     * @param integer $pointChartWithoutDlc
124
     * @return $this
125
     */
126
    public function setPointChartWithoutDlc(int $pointChartWithoutDlc): static
127
    {
128
        $this->pointChartWithoutDlc = $pointChartWithoutDlc;
129
        return $this;
130
    }
131
132
    /**
133
     * Get pointChartWithoutDlc
134
     *
135
     * @return integer
136
     */
137
    public function getPointChartWithoutDlc(): int
138
    {
139
        return $this->pointChartWithoutDlc;
140
    }
141
142
143
    /**
144
     * Set pointGame
145
     * @param integer $pointGame
146
     * @return $this
147
     */
148
    public function setPointGame(int $pointGame): static
149
    {
150
        $this->pointGame = $pointGame;
151
        return $this;
152
    }
153
154
    /**
155
     * Get pointGame
156
     *
157
     * @return integer
158
     */
159
    public function getPointGame(): int
160
    {
161
        return $this->pointGame;
162
    }
163
164
    /**
165
     * Set lastUpdate
166
     * @param DateTime $lastUpdate
167
     * @return $this
168
     */
169
    public function setLastUpdate(DateTime $lastUpdate): static
170
    {
171
        $this->lastUpdate = $lastUpdate;
172
173
        return $this;
174
    }
175
176
    /**
177
     * Get lastUpdate
178
     *
179
     * @return DateTime
180
     */
181
    public function getLastUpdate(): DateTime
182
    {
183
        return $this->lastUpdate;
184
    }
185
186
    /**
187
     * @param $statuses
188
     */
189
    public function setStatuses($statuses)
190
    {
191
        $this->statuses = $statuses;
192
    }
193
194
    /**
195
     * @return mixed
196
     */
197
    public function getStatuses()
198
    {
199
        return $this->statuses;
200
    }
201
}
202