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
|
|
|
|
12
|
|
|
/** |
13
|
|
|
* Category. |
14
|
|
|
*/ |
15
|
|
|
#[ORM\Table(name: 'ticket_category')] |
16
|
|
|
#[ORM\Entity] |
17
|
|
|
class TicketCategory |
18
|
|
|
{ |
19
|
|
|
#[ORM\Column(name: 'id', type: 'integer')] |
20
|
|
|
#[ORM\Id] |
21
|
|
|
#[ORM\GeneratedValue] |
22
|
|
|
protected ?int $id = null; |
23
|
|
|
|
24
|
|
|
#[ORM\Column(name: 'title', type: 'string', length: 255, nullable: false)] |
25
|
|
|
protected string $title; |
26
|
|
|
|
27
|
|
|
#[ORM\Column(name: 'description', type: 'text', nullable: true)] |
28
|
|
|
protected ?string $description = null; |
29
|
|
|
|
30
|
|
|
#[ORM\Column(name: 'total_tickets', type: 'integer', nullable: false)] |
31
|
|
|
protected int $totalTickets; |
32
|
|
|
|
33
|
|
|
#[ORM\Column(name: 'course_required', type: 'boolean', nullable: false)] |
34
|
|
|
protected bool $courseRequired; |
35
|
|
|
|
36
|
|
|
#[ORM\ManyToOne(targetEntity: TicketProject::class)] |
37
|
|
|
#[ORM\JoinColumn(name: 'project_id', referencedColumnName: 'id')] |
38
|
|
|
protected TicketProject $project; |
39
|
|
|
|
40
|
|
|
#[ORM\Column(name: 'sys_insert_user_id', type: 'integer')] |
41
|
|
|
protected int $insertUserId; |
42
|
|
|
|
43
|
|
|
#[ORM\Column(name: 'sys_insert_datetime', type: 'datetime')] |
44
|
|
|
protected DateTime $insertDateTime; |
45
|
|
|
|
46
|
|
|
#[ORM\Column(name: 'sys_lastedit_user_id', type: 'integer', nullable: true, unique: false)] |
47
|
|
|
protected ?int $lastEditUserId = null; |
48
|
|
|
|
49
|
|
|
#[ORM\Column(name: 'sys_lastedit_datetime', type: 'datetime', nullable: true, unique: false)] |
50
|
|
|
protected ?DateTime $lastEditDateTime = null; |
51
|
|
|
|
52
|
|
|
public function __construct() |
53
|
|
|
{ |
54
|
|
|
$this->totalTickets = 0; |
55
|
|
|
$this->insertDateTime = new DateTime(); |
56
|
|
|
} |
57
|
|
|
|
58
|
|
|
/** |
59
|
|
|
* @return int |
60
|
|
|
*/ |
61
|
|
|
public function getId() |
62
|
|
|
{ |
63
|
|
|
return $this->id; |
64
|
|
|
} |
65
|
|
|
|
66
|
|
|
/** |
67
|
|
|
* @return string |
68
|
|
|
*/ |
69
|
|
|
public function getTitle() |
70
|
|
|
{ |
71
|
|
|
return $this->title; |
72
|
|
|
} |
73
|
|
|
|
74
|
|
|
public function setTitle(string $title): self |
75
|
|
|
{ |
76
|
|
|
$this->title = $title; |
77
|
|
|
|
78
|
|
|
return $this; |
79
|
|
|
} |
80
|
|
|
|
81
|
|
|
/** |
82
|
|
|
* @return string |
83
|
|
|
*/ |
84
|
|
|
public function getDescription() |
85
|
|
|
{ |
86
|
|
|
return $this->description; |
87
|
|
|
} |
88
|
|
|
|
89
|
|
|
public function setDescription(string $description): self |
90
|
|
|
{ |
91
|
|
|
$this->description = $description; |
92
|
|
|
|
93
|
|
|
return $this; |
94
|
|
|
} |
95
|
|
|
|
96
|
|
|
/** |
97
|
|
|
* @return int |
98
|
|
|
*/ |
99
|
|
|
public function getTotalTickets() |
100
|
|
|
{ |
101
|
|
|
return $this->totalTickets; |
102
|
|
|
} |
103
|
|
|
|
104
|
|
|
public function setTotalTickets(int $totalTickets): self |
105
|
|
|
{ |
106
|
|
|
$this->totalTickets = $totalTickets; |
107
|
|
|
|
108
|
|
|
return $this; |
109
|
|
|
} |
110
|
|
|
|
111
|
|
|
public function isCourseRequired(): bool |
112
|
|
|
{ |
113
|
|
|
return $this->courseRequired; |
114
|
|
|
} |
115
|
|
|
|
116
|
|
|
public function setCourseRequired(bool $courseRequired): self |
117
|
|
|
{ |
118
|
|
|
$this->courseRequired = $courseRequired; |
119
|
|
|
|
120
|
|
|
return $this; |
121
|
|
|
} |
122
|
|
|
|
123
|
|
|
/** |
124
|
|
|
* @return TicketProject |
125
|
|
|
*/ |
126
|
|
|
public function getProject() |
127
|
|
|
{ |
128
|
|
|
return $this->project; |
129
|
|
|
} |
130
|
|
|
|
131
|
|
|
public function setProject(TicketProject $project): self |
132
|
|
|
{ |
133
|
|
|
$this->project = $project; |
134
|
|
|
|
135
|
|
|
return $this; |
136
|
|
|
} |
137
|
|
|
|
138
|
|
|
/** |
139
|
|
|
* @return int |
140
|
|
|
*/ |
141
|
|
|
public function getInsertUserId() |
142
|
|
|
{ |
143
|
|
|
return $this->insertUserId; |
144
|
|
|
} |
145
|
|
|
|
146
|
|
|
/** |
147
|
|
|
* @return TicketCategory |
148
|
|
|
*/ |
149
|
|
|
public function setInsertUserId(int $insertUserId) |
150
|
|
|
{ |
151
|
|
|
$this->insertUserId = $insertUserId; |
152
|
|
|
|
153
|
|
|
return $this; |
154
|
|
|
} |
155
|
|
|
|
156
|
|
|
/** |
157
|
|
|
* @return DateTime |
158
|
|
|
*/ |
159
|
|
|
public function getInsertDateTime() |
160
|
|
|
{ |
161
|
|
|
return $this->insertDateTime; |
162
|
|
|
} |
163
|
|
|
|
164
|
|
|
public function setInsertDateTime(DateTime $insertDateTime): self |
165
|
|
|
{ |
166
|
|
|
$this->insertDateTime = $insertDateTime; |
167
|
|
|
|
168
|
|
|
return $this; |
169
|
|
|
} |
170
|
|
|
|
171
|
|
|
/** |
172
|
|
|
* @return int |
173
|
|
|
*/ |
174
|
|
|
public function getLastEditUserId() |
175
|
|
|
{ |
176
|
|
|
return $this->lastEditUserId; |
177
|
|
|
} |
178
|
|
|
|
179
|
|
|
/** |
180
|
|
|
* @return TicketCategory |
181
|
|
|
*/ |
182
|
|
|
public function setLastEditUserId(int $lastEditUserId) |
183
|
|
|
{ |
184
|
|
|
$this->lastEditUserId = $lastEditUserId; |
185
|
|
|
|
186
|
|
|
return $this; |
187
|
|
|
} |
188
|
|
|
|
189
|
|
|
/** |
190
|
|
|
* @return DateTime |
191
|
|
|
*/ |
192
|
|
|
public function getLastEditDateTime() |
193
|
|
|
{ |
194
|
|
|
return $this->lastEditDateTime; |
195
|
|
|
} |
196
|
|
|
|
197
|
|
|
public function setLastEditDateTime(DateTime $lastEditDateTime): self |
198
|
|
|
{ |
199
|
|
|
$this->lastEditDateTime = $lastEditDateTime; |
200
|
|
|
|
201
|
|
|
return $this; |
202
|
|
|
} |
203
|
|
|
} |
204
|
|
|
|