1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace VideoGamesRecords\CoreBundle\Entity; |
4
|
|
|
|
5
|
|
|
use DateTime; |
6
|
|
|
use Doctrine\ORM\Mapping as ORM; |
7
|
|
|
use VideoGamesRecords\CoreBundle\Model\Entity\NbChartProvenTrait; |
8
|
|
|
use VideoGamesRecords\CoreBundle\Model\Entity\NbChartTrait; |
9
|
|
|
use VideoGamesRecords\CoreBundle\Model\Entity\RankMedalTrait; |
10
|
|
|
use VideoGamesRecords\CoreBundle\Model\Entity\RankPointChartTrait; |
11
|
|
|
|
12
|
|
|
/** |
13
|
|
|
* PlayerGroup |
14
|
|
|
* |
15
|
|
|
* @ORM\Table(name="vgr_player_group") |
16
|
|
|
* @ORM\Entity(repositoryClass="VideoGamesRecords\CoreBundle\Repository\PlayerGroupRepository") |
17
|
|
|
*/ |
18
|
|
|
class PlayerGroup |
19
|
|
|
{ |
20
|
|
|
use NbChartTrait; |
21
|
|
|
use NbChartProvenTrait; |
22
|
|
|
use RankMedalTrait; |
23
|
|
|
use RankPointChartTrait; |
24
|
|
|
|
25
|
|
|
/** |
26
|
|
|
* @ORM\Id |
27
|
|
|
* @ORM\ManyToOne(targetEntity="VideoGamesRecords\CoreBundle\Entity\Player") |
28
|
|
|
* @ORM\JoinColumns({ |
29
|
|
|
* @ORM\JoinColumn(name="idPlayer", referencedColumnName="id", nullable=false, onDelete="CASCADE") |
30
|
|
|
* }) |
31
|
|
|
*/ |
32
|
|
|
private Player $player; |
33
|
|
|
|
34
|
|
|
/** |
35
|
|
|
* @ORM\Id |
36
|
|
|
* @ORM\ManyToOne(targetEntity="VideoGamesRecords\CoreBundle\Entity\Group", fetch="EAGER") |
37
|
|
|
* @ORM\JoinColumns({ |
38
|
|
|
* @ORM\JoinColumn(name="idGroup", referencedColumnName="id", nullable=false, onDelete="CASCADE") |
39
|
|
|
* }) |
40
|
|
|
*/ |
41
|
|
|
private Group $group; |
42
|
|
|
|
43
|
|
|
|
44
|
|
|
/** |
45
|
|
|
* @ORM\Column(name="lastUpdate", type="datetime", nullable=true) |
46
|
|
|
*/ |
47
|
|
|
private DateTime $lastUpdate; |
48
|
|
|
|
49
|
|
|
|
50
|
|
|
/** |
51
|
|
|
* Set lastUpdate |
52
|
|
|
* @param DateTime $lastUpdate |
53
|
|
|
* @return $this |
54
|
|
|
*/ |
55
|
|
|
public function setLastUpdate(DateTime $lastUpdate): Self |
56
|
|
|
{ |
57
|
|
|
$this->lastUpdate = $lastUpdate; |
58
|
|
|
|
59
|
|
|
return $this; |
60
|
|
|
} |
61
|
|
|
|
62
|
|
|
/** |
63
|
|
|
* Get lastUpdate |
64
|
|
|
* |
65
|
|
|
* @return DateTime |
66
|
|
|
*/ |
67
|
|
|
public function getLastUpdate(): DateTime |
68
|
|
|
{ |
69
|
|
|
return $this->lastUpdate; |
70
|
|
|
} |
71
|
|
|
|
72
|
|
|
|
73
|
|
|
/** |
74
|
|
|
* Set group |
75
|
|
|
* @param Group $group |
76
|
|
|
* @return $this |
77
|
|
|
*/ |
78
|
|
|
public function setGroup(Group $group): Self |
79
|
|
|
{ |
80
|
|
|
$this->group = $group; |
81
|
|
|
|
82
|
|
|
return $this; |
83
|
|
|
} |
84
|
|
|
|
85
|
|
|
/** |
86
|
|
|
* Get group |
87
|
|
|
* |
88
|
|
|
* @return Group |
89
|
|
|
*/ |
90
|
|
|
public function getGroup(): Group |
91
|
|
|
{ |
92
|
|
|
return $this->group; |
93
|
|
|
} |
94
|
|
|
|
95
|
|
|
|
96
|
|
|
/** |
97
|
|
|
* Set player |
98
|
|
|
* @param Player $player |
99
|
|
|
* @return $this |
100
|
|
|
*/ |
101
|
|
|
public function setPlayer(Player $player): Self |
102
|
|
|
{ |
103
|
|
|
$this->player = $player; |
104
|
|
|
|
105
|
|
|
return $this; |
106
|
|
|
} |
107
|
|
|
|
108
|
|
|
/** |
109
|
|
|
* Get player |
110
|
|
|
* |
111
|
|
|
* @return Player |
112
|
|
|
*/ |
113
|
|
|
public function getPlayer(): Player |
114
|
|
|
{ |
115
|
|
|
return $this->player; |
116
|
|
|
} |
117
|
|
|
} |
118
|
|
|
|