|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace VideoGamesRecords\CoreBundle\Entity; |
|
4
|
|
|
|
|
5
|
|
|
use DateTime; |
|
6
|
|
|
use Doctrine\ORM\Mapping as ORM; |
|
7
|
|
|
use Gedmo\Timestampable\Traits\TimestampableEntity; |
|
8
|
|
|
use VideoGamesRecords\CoreBundle\ValueObject\ProofRequestStatus; |
|
9
|
|
|
|
|
10
|
|
|
/** |
|
11
|
|
|
* Request |
|
12
|
|
|
* @ORM\Table(name="vgr_proof_request") |
|
13
|
|
|
* @ORM\Entity(repositoryClass="VideoGamesRecords\CoreBundle\Repository\ProofRequestRepository") |
|
14
|
|
|
* @ORM\EntityListeners({"VideoGamesRecords\CoreBundle\EventListener\Entity\ProofRequestListener"}) |
|
15
|
|
|
*/ |
|
16
|
|
|
class ProofRequest |
|
17
|
|
|
{ |
|
18
|
|
|
use TimestampableEntity; |
|
19
|
|
|
|
|
20
|
|
|
/** |
|
21
|
|
|
* @ORM\Column(name="id", type="integer") |
|
22
|
|
|
* @ORM\Id |
|
23
|
|
|
* @ORM\GeneratedValue(strategy="IDENTITY") |
|
24
|
|
|
*/ |
|
25
|
|
|
private ?int $id = null; |
|
26
|
|
|
|
|
27
|
|
|
/** |
|
28
|
|
|
* @ORM\Column(name="status", type="string", length=50, nullable=false) |
|
29
|
|
|
*/ |
|
30
|
|
|
private string $status = ProofRequestStatus::STATUS_IN_PROGRESS; |
|
31
|
|
|
|
|
32
|
|
|
/** |
|
33
|
|
|
* @ORM\Column(name="response", type="text", nullable=true) |
|
34
|
|
|
*/ |
|
35
|
|
|
private ?string $response = null; |
|
36
|
|
|
|
|
37
|
|
|
/** |
|
38
|
|
|
* @ORM\Column(name="message", type="text", nullable=true) |
|
39
|
|
|
*/ |
|
40
|
|
|
private ?string $message = null; |
|
41
|
|
|
|
|
42
|
|
|
/** |
|
43
|
|
|
* @ORM\Column(name="dateAcceptance", type="datetime", nullable=true) |
|
44
|
|
|
*/ |
|
45
|
|
|
private ?Datetime $dateAcceptance = null; |
|
46
|
|
|
|
|
47
|
|
|
/** |
|
48
|
|
|
* @ORM\ManyToOne(targetEntity="VideoGamesRecords\CoreBundle\Entity\PlayerChart") |
|
49
|
|
|
* @ORM\JoinColumns({ |
|
50
|
|
|
* @ORM\JoinColumn(name="idPlayerChart", referencedColumnName="id", nullable=false, onDelete="CASCADE") |
|
51
|
|
|
* }) |
|
52
|
|
|
*/ |
|
53
|
|
|
private PlayerChart $playerChart; |
|
54
|
|
|
|
|
55
|
|
|
/** |
|
56
|
|
|
* @ORM\ManyToOne(targetEntity="VideoGamesRecords\CoreBundle\Entity\Player") |
|
57
|
|
|
* @ORM\JoinColumns({ |
|
58
|
|
|
* @ORM\JoinColumn(name="idPlayerRequesting", referencedColumnName="id", nullable=false) |
|
59
|
|
|
* }) |
|
60
|
|
|
*/ |
|
61
|
|
|
private Player $playerRequesting; |
|
62
|
|
|
|
|
63
|
|
|
/** |
|
64
|
|
|
* @ORM\ManyToOne(targetEntity="VideoGamesRecords\CoreBundle\Entity\Player") |
|
65
|
|
|
* @ORM\JoinColumns({ |
|
66
|
|
|
* @ORM\JoinColumn(name="idPlayerResponding", referencedColumnName="id", nullable=true) |
|
67
|
|
|
* }) |
|
68
|
|
|
*/ |
|
69
|
|
|
private ?Player $playerResponding = null; |
|
70
|
|
|
|
|
71
|
|
|
/** |
|
72
|
|
|
* @return string |
|
73
|
|
|
*/ |
|
74
|
|
|
public function __toString() |
|
75
|
|
|
{ |
|
76
|
|
|
return sprintf('Request [%s]', $this->id); |
|
77
|
|
|
} |
|
78
|
|
|
|
|
79
|
|
|
|
|
80
|
|
|
/** |
|
81
|
|
|
* Set id |
|
82
|
|
|
* @param integer $id |
|
83
|
|
|
* @return $this |
|
84
|
|
|
*/ |
|
85
|
|
|
public function setId(int $id): self |
|
86
|
|
|
{ |
|
87
|
|
|
$this->id = $id; |
|
88
|
|
|
return $this; |
|
89
|
|
|
} |
|
90
|
|
|
|
|
91
|
|
|
/** |
|
92
|
|
|
* Get id |
|
93
|
|
|
* @return integer |
|
94
|
|
|
*/ |
|
95
|
|
|
public function getId(): ?int |
|
96
|
|
|
{ |
|
97
|
|
|
return $this->id; |
|
98
|
|
|
} |
|
99
|
|
|
|
|
100
|
|
|
/** |
|
101
|
|
|
* Set status |
|
102
|
|
|
* @param string $status |
|
103
|
|
|
* @return $this |
|
104
|
|
|
*/ |
|
105
|
|
|
public function setStatus(string $status): self |
|
106
|
|
|
{ |
|
107
|
|
|
$this->status = $status; |
|
108
|
|
|
return $this; |
|
109
|
|
|
} |
|
110
|
|
|
|
|
111
|
|
|
/** |
|
112
|
|
|
* Get status |
|
113
|
|
|
* @return string |
|
114
|
|
|
*/ |
|
115
|
|
|
public function getStatus(): string |
|
116
|
|
|
{ |
|
117
|
|
|
return $this->status; |
|
118
|
|
|
} |
|
119
|
|
|
|
|
120
|
|
|
/** |
|
121
|
|
|
* Set response |
|
122
|
|
|
* @param string $response |
|
123
|
|
|
* @return $this |
|
124
|
|
|
*/ |
|
125
|
|
|
public function setResponse(string $response): self |
|
126
|
|
|
{ |
|
127
|
|
|
$this->response = $response; |
|
128
|
|
|
return $this; |
|
129
|
|
|
} |
|
130
|
|
|
|
|
131
|
|
|
/** |
|
132
|
|
|
* Get response |
|
133
|
|
|
* @return string |
|
134
|
|
|
*/ |
|
135
|
|
|
public function getResponse(): ?string |
|
136
|
|
|
{ |
|
137
|
|
|
return $this->response; |
|
138
|
|
|
} |
|
139
|
|
|
|
|
140
|
|
|
/** |
|
141
|
|
|
* Set dateAcceptance |
|
142
|
|
|
* @param DateTime $dateAcceptance |
|
143
|
|
|
* @return $this |
|
144
|
|
|
*/ |
|
145
|
|
|
public function setDateAcceptance(DateTime $dateAcceptance): self |
|
146
|
|
|
{ |
|
147
|
|
|
$this->dateAcceptance = $dateAcceptance; |
|
148
|
|
|
return $this; |
|
149
|
|
|
} |
|
150
|
|
|
|
|
151
|
|
|
/** |
|
152
|
|
|
* Get dateAcceptance |
|
153
|
|
|
* @return DateTime |
|
154
|
|
|
*/ |
|
155
|
|
|
public function getDateAcceptance(): ?DateTime |
|
156
|
|
|
{ |
|
157
|
|
|
return $this->dateAcceptance; |
|
158
|
|
|
} |
|
159
|
|
|
|
|
160
|
|
|
/** |
|
161
|
|
|
* Set message |
|
162
|
|
|
* @param string $message |
|
163
|
|
|
* @return $this |
|
164
|
|
|
*/ |
|
165
|
|
|
public function setMessage(string $message): self |
|
166
|
|
|
{ |
|
167
|
|
|
$this->message = $message; |
|
168
|
|
|
return $this; |
|
169
|
|
|
} |
|
170
|
|
|
|
|
171
|
|
|
/** |
|
172
|
|
|
* Get message |
|
173
|
|
|
* @return string |
|
174
|
|
|
*/ |
|
175
|
|
|
public function getMessage(): ?string |
|
176
|
|
|
{ |
|
177
|
|
|
return $this->message; |
|
178
|
|
|
} |
|
179
|
|
|
|
|
180
|
|
|
/** |
|
181
|
|
|
* Set playerCHart |
|
182
|
|
|
* @param PlayerChart $playerChart |
|
183
|
|
|
* @return $this |
|
184
|
|
|
*/ |
|
185
|
|
|
public function setPlayerChart(PlayerChart $playerChart): self |
|
186
|
|
|
{ |
|
187
|
|
|
$this->playerChart = $playerChart; |
|
188
|
|
|
|
|
189
|
|
|
return $this; |
|
190
|
|
|
} |
|
191
|
|
|
|
|
192
|
|
|
/** |
|
193
|
|
|
* Get playerChart |
|
194
|
|
|
* @return PlayerChart |
|
195
|
|
|
*/ |
|
196
|
|
|
public function getPlayerChart(): PlayerChart |
|
197
|
|
|
{ |
|
198
|
|
|
return $this->playerChart; |
|
199
|
|
|
} |
|
200
|
|
|
|
|
201
|
|
|
/** |
|
202
|
|
|
* Set playerRequesting |
|
203
|
|
|
* @param Player $playerRequesting |
|
204
|
|
|
* @return $this |
|
205
|
|
|
*/ |
|
206
|
|
|
public function setPlayerRequesting(Player $playerRequesting): self |
|
207
|
|
|
{ |
|
208
|
|
|
$this->playerRequesting = $playerRequesting; |
|
209
|
|
|
|
|
210
|
|
|
return $this; |
|
211
|
|
|
} |
|
212
|
|
|
|
|
213
|
|
|
/** |
|
214
|
|
|
* Get playerRequesting |
|
215
|
|
|
* @return Player |
|
216
|
|
|
*/ |
|
217
|
|
|
public function getPlayerRequesting(): Player |
|
218
|
|
|
{ |
|
219
|
|
|
return $this->playerRequesting; |
|
220
|
|
|
} |
|
221
|
|
|
|
|
222
|
|
|
/** |
|
223
|
|
|
* Set playerResponding |
|
224
|
|
|
* @param Player|null $playerResponding |
|
225
|
|
|
* @return $this |
|
226
|
|
|
*/ |
|
227
|
|
|
public function setPlayerResponding(Player $playerResponding = null): self |
|
228
|
|
|
{ |
|
229
|
|
|
$this->playerResponding = $playerResponding; |
|
230
|
|
|
|
|
231
|
|
|
return $this; |
|
232
|
|
|
} |
|
233
|
|
|
|
|
234
|
|
|
/** |
|
235
|
|
|
* Get playerResponding |
|
236
|
|
|
* @return Player|null |
|
237
|
|
|
*/ |
|
238
|
|
|
public function getPlayerResponding(): ?Player |
|
239
|
|
|
{ |
|
240
|
|
|
return $this->playerResponding; |
|
241
|
|
|
} |
|
242
|
|
|
} |
|
243
|
|
|
|