1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare(strict_types=1); |
4
|
|
|
|
5
|
|
|
/* For licensing terms, see /license.txt */ |
6
|
|
|
|
7
|
|
|
namespace Chamilo\CoreBundle\Entity; |
8
|
|
|
|
9
|
|
|
use DateTime; |
10
|
|
|
use Doctrine\ORM\Mapping as ORM; |
11
|
|
|
use Symfony\Component\Validator\Constraints as Assert; |
12
|
|
|
|
13
|
|
|
/** |
14
|
|
|
* @ORM\Table(name="ticket_ticket") |
15
|
|
|
* @ORM\Entity |
16
|
|
|
*/ |
17
|
|
|
class Ticket |
18
|
|
|
{ |
19
|
|
|
/** |
20
|
|
|
* @ORM\Column(name="id", type="integer") |
21
|
|
|
* @ORM\Id |
22
|
|
|
* @ORM\GeneratedValue |
23
|
|
|
*/ |
24
|
|
|
protected int $id; |
25
|
|
|
|
26
|
|
|
/** |
27
|
|
|
* @ORM\Column(name="code", type="string", length=255, nullable=false) |
28
|
|
|
*/ |
29
|
|
|
protected string $code; |
30
|
|
|
|
31
|
|
|
/** |
32
|
|
|
* @ORM\Column(name="subject", type="string", length=255, nullable=false) |
33
|
|
|
*/ |
34
|
|
|
protected string $subject; |
35
|
|
|
|
36
|
|
|
/** |
37
|
|
|
* @ORM\Column(name="message", type="text", nullable=true) |
38
|
|
|
*/ |
39
|
|
|
protected ?string $message = null; |
40
|
|
|
|
41
|
|
|
/** |
42
|
|
|
* @ORM\ManyToOne(targetEntity="TicketProject") |
43
|
|
|
* @ORM\JoinColumn(name="project_id", referencedColumnName="id") |
44
|
|
|
*/ |
45
|
|
|
protected TicketProject $project; |
46
|
|
|
|
47
|
|
|
/** |
48
|
|
|
* @ORM\ManyToOne(targetEntity="TicketCategory") |
49
|
|
|
* @ORM\JoinColumn(name="category_id", referencedColumnName="id") |
50
|
|
|
*/ |
51
|
|
|
protected TicketCategory $category; |
52
|
|
|
|
53
|
|
|
/** |
54
|
|
|
* @ORM\ManyToOne(targetEntity="TicketPriority") |
55
|
|
|
* @ORM\JoinColumn(name="priority_id", referencedColumnName="id") |
56
|
|
|
*/ |
57
|
|
|
protected TicketPriority $priority; |
58
|
|
|
|
59
|
|
|
/** |
60
|
|
|
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\Course") |
61
|
|
|
* @ORM\JoinColumn(name="course_id", referencedColumnName="id", onDelete="CASCADE") |
62
|
|
|
*/ |
63
|
|
|
protected Course $course; |
64
|
|
|
|
65
|
|
|
/** |
66
|
|
|
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\Session") |
67
|
|
|
* @ORM\JoinColumn(name="session_id", referencedColumnName="id", onDelete="CASCADE") |
68
|
|
|
*/ |
69
|
|
|
protected Session $session; |
70
|
|
|
|
71
|
|
|
/** |
72
|
|
|
* @ORM\Column(name="personal_email", type="string", length=255, nullable=false) |
73
|
|
|
*/ |
74
|
|
|
#[Assert\NotBlank] |
75
|
|
|
protected string $personalEmail; |
76
|
|
|
|
77
|
|
|
/** |
78
|
|
|
* @ORM\Column(name="assigned_last_user", type="integer", nullable=true) |
79
|
|
|
*/ |
80
|
|
|
/** |
81
|
|
|
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\User") |
82
|
|
|
* @ORM\JoinColumn(name="assigned_last_user", referencedColumnName="id", onDelete="CASCADE") |
83
|
|
|
*/ |
84
|
|
|
protected ?User $assignedLastUser = null; |
85
|
|
|
|
86
|
|
|
/** |
87
|
|
|
* @ORM\ManyToOne(targetEntity="TicketStatus") |
88
|
|
|
* @ORM\JoinColumn(name="status_id", referencedColumnName="id") |
89
|
|
|
*/ |
90
|
|
|
protected TicketStatus $status; |
91
|
|
|
|
92
|
|
|
/** |
93
|
|
|
* @ORM\Column(name="total_messages", type="integer", nullable=false) |
94
|
|
|
*/ |
95
|
|
|
protected int $totalMessages; |
96
|
|
|
|
97
|
|
|
/** |
98
|
|
|
* @ORM\Column(name="keyword", type="string", length=255, nullable=true) |
99
|
|
|
*/ |
100
|
|
|
protected ?string $keyword = null; |
101
|
|
|
|
102
|
|
|
/** |
103
|
|
|
* @ORM\Column(name="source", type="string", length=255, nullable=true) |
104
|
|
|
*/ |
105
|
|
|
protected ?string $source = null; |
106
|
|
|
|
107
|
|
|
/** |
108
|
|
|
* @ORM\Column(name="start_date", type="datetime", nullable=true, unique=false) |
109
|
|
|
*/ |
110
|
|
|
protected ?DateTime $startDate = null; |
111
|
|
|
|
112
|
|
|
/** |
113
|
|
|
* @ORM\Column(name="end_date", type="datetime", nullable=true, unique=false) |
114
|
|
|
*/ |
115
|
|
|
protected ?DateTime $endDate = null; |
116
|
|
|
|
117
|
|
|
/** |
118
|
|
|
* @ORM\Column(name="sys_insert_user_id", type="integer") |
119
|
|
|
*/ |
120
|
|
|
protected int $insertUserId; |
121
|
|
|
|
122
|
|
|
/** |
123
|
|
|
* @ORM\Column(name="sys_insert_datetime", type="datetime") |
124
|
|
|
*/ |
125
|
|
|
protected DateTime $insertDateTime; |
126
|
|
|
|
127
|
|
|
/** |
128
|
|
|
* @ORM\Column(name="sys_lastedit_user_id", type="integer", nullable=true, unique=false) |
129
|
|
|
*/ |
130
|
|
|
protected int $lastEditUserId; |
131
|
|
|
|
132
|
|
|
/** |
133
|
|
|
* @ORM\Column(name="sys_lastedit_datetime", type="datetime", nullable=true, unique=false) |
134
|
|
|
*/ |
135
|
|
|
protected DateTime $lastEditDateTime; |
136
|
|
|
|
137
|
|
|
public function __construct() |
138
|
|
|
{ |
139
|
|
|
$this->totalMessages = 0; |
140
|
|
|
$this->insertDateTime = new DateTime(); |
141
|
|
|
} |
142
|
|
|
|
143
|
|
|
/** |
144
|
|
|
* @return int |
145
|
|
|
*/ |
146
|
|
|
public function getId() |
147
|
|
|
{ |
148
|
|
|
return $this->id; |
149
|
|
|
} |
150
|
|
|
|
151
|
|
|
/** |
152
|
|
|
* @return string |
153
|
|
|
*/ |
154
|
|
|
public function getCode() |
155
|
|
|
{ |
156
|
|
|
return $this->code; |
157
|
|
|
} |
158
|
|
|
|
159
|
|
|
public function setCode(string $code): self |
160
|
|
|
{ |
161
|
|
|
$this->code = $code; |
162
|
|
|
|
163
|
|
|
return $this; |
164
|
|
|
} |
165
|
|
|
|
166
|
|
|
/** |
167
|
|
|
* @return string |
168
|
|
|
*/ |
169
|
|
|
public function getSubject() |
170
|
|
|
{ |
171
|
|
|
return $this->subject; |
172
|
|
|
} |
173
|
|
|
|
174
|
|
|
public function setSubject(string $subject): self |
175
|
|
|
{ |
176
|
|
|
$this->subject = $subject; |
177
|
|
|
|
178
|
|
|
return $this; |
179
|
|
|
} |
180
|
|
|
|
181
|
|
|
/** |
182
|
|
|
* @return string |
183
|
|
|
*/ |
184
|
|
|
public function getMessage() |
185
|
|
|
{ |
186
|
|
|
return $this->message; |
187
|
|
|
} |
188
|
|
|
|
189
|
|
|
public function setMessage(string $message): self |
190
|
|
|
{ |
191
|
|
|
$this->message = $message; |
192
|
|
|
|
193
|
|
|
return $this; |
194
|
|
|
} |
195
|
|
|
|
196
|
|
|
public function getAssignedLastUser(): ?User |
197
|
|
|
{ |
198
|
|
|
return $this->assignedLastUser; |
199
|
|
|
} |
200
|
|
|
|
201
|
|
|
public function setAssignedLastUser(?User $assignedLastUser): self |
202
|
|
|
{ |
203
|
|
|
$this->assignedLastUser = $assignedLastUser; |
204
|
|
|
|
205
|
|
|
return $this; |
206
|
|
|
} |
207
|
|
|
|
208
|
|
|
public function getPersonalEmail(): string |
209
|
|
|
{ |
210
|
|
|
return $this->personalEmail; |
211
|
|
|
} |
212
|
|
|
|
213
|
|
|
public function setPersonalEmail(string $personalEmail): self |
214
|
|
|
{ |
215
|
|
|
$this->personalEmail = $personalEmail; |
216
|
|
|
|
217
|
|
|
return $this; |
218
|
|
|
} |
219
|
|
|
|
220
|
|
|
public function getTotalMessages(): int |
221
|
|
|
{ |
222
|
|
|
return $this->totalMessages; |
223
|
|
|
} |
224
|
|
|
|
225
|
|
|
public function setTotalMessages(int $totalMessages): self |
226
|
|
|
{ |
227
|
|
|
$this->totalMessages = $totalMessages; |
228
|
|
|
|
229
|
|
|
return $this; |
230
|
|
|
} |
231
|
|
|
|
232
|
|
|
public function getInsertUserId(): int |
233
|
|
|
{ |
234
|
|
|
return $this->insertUserId; |
235
|
|
|
} |
236
|
|
|
|
237
|
|
|
public function setInsertUserId(int $insertUserId): self |
238
|
|
|
{ |
239
|
|
|
$this->insertUserId = $insertUserId; |
240
|
|
|
|
241
|
|
|
return $this; |
242
|
|
|
} |
243
|
|
|
} |
244
|
|
|
|