forked from liuggio/HelpDeskBundle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Ticket.php~
executable file
·277 lines (239 loc) · 4.74 KB
/
Ticket.php~
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
<?php
namespace Liuggio\HelpDeskTicketSystemBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Liuggio\HelpDeskTicketSystemBundle\Entity\Category;
/**
* Liuggio\HelpDeskTicketSystemBundle\Entity\Ticket
*/
class Ticket
{
/**
* @var integer $id
*/
private $id;
/**
* @var string $subject
*/
private $subject;
/**
* @var text $body
*/
private $body;
/**
* @var string $language
*/
private $language;
/**
* @var datetime $createdAt
*/
private $createdAt;
/**
* @var datetime $updatedAt
*/
private $updatedAt;
/**
* @var TicketState $state
*/
private $state;
/**
* @var \Liuggio\HelpDeskTicketSystemBundle\Entity\Category $category
*/
private $category;
/**
* @var Liuggio\HelpDeskTicketSystemBundle\Entity\Comment
*/
private $comments;
public function __construct()
{
$this->comments = new \Doctrine\Common\Collections\ArrayCollection();
}
/**
* @return string
*/
public function __toString()
{
return $this->getSubject();
}
/**
* Get id
*
* @return integer
*/
public function getId()
{
return $this->id;
}
/**
* Set subject
*
* @param string $subject
*/
public function setSubject($subject)
{
$this->subject = $subject;
}
/**
* Get subject
*
* @return string
*/
public function getSubject()
{
return $this->subject;
}
/**
* Set body
*
* @param text $body
*/
public function setBody($body)
{
$this->body = $body;
}
/**
* Get body
*
* @return text
*/
public function getBody()
{
return $this->body;
}
/**
* Set language
*
* @param string $language
*/
public function setLanguage($language)
{
$this->language = $language;
}
/**
* Get language
*
* @return string
*/
public function getLanguage()
{
return $this->language;
}
/**
* Set createdAt
*
* @param datetime $createdAt
*/
public function setCreatedAt($createdAt)
{
$this->createdAt = $createdAt;
}
/**
* Get createdAt
*
* @return datetime
*/
public function getCreatedAt()
{
return $this->createdAt;
}
/**
* Set updatedAt
*
* @param datetime $updatedAt
*/
public function setUpdatedAt($updatedAt)
{
$this->updatedAt = $updatedAt;
}
/**
* Get updatedAt
*
* @return datetime
*/
public function getUpdatedAt()
{
return $this->updatedAt;
}
/**
* @param \Liuggio\HelpDeskTicketSystemBundle\Entity\Category $category
*/
public function setCategory(\Liuggio\HelpDeskTicketSystemBundle\Entity\Category $category)
{
$this->category = $category;
}
/**
* @return \Liuggio\HelpDeskTicketSystemBundle\Entity\Category
*/
public function getCategory()
{
return $this->category;
}
/**
* Add comments
*
* @param Liuggio\HelpDeskTicketSystemBundle\Entity\Comment $comments
*/
public function addComment(\Liuggio\HelpDeskTicketSystemBundle\Entity\Comment $comments)
{
$this->comments[] = $comments;
}
/**
* Get comments
*
* @return Doctrine\Common\Collections\Collection
*/
public function getComments()
{
return $this->comments;
}
/**
* Set state
*
* @param Liuggio\HelpDeskTicketSystemBundle\Entity\TicketState $state
*/
public function setState(\Liuggio\HelpDeskTicketSystemBundle\Entity\TicketState $state)
{
$this->state = $state;
}
/**
* Get state
*
* @return Liuggio\HelpDeskTicketSystemBundle\Entity\TicketState
*/
public function getState()
{
return $this->state;
}
public function prePersist()
{
$now = new \DateTime('NOW');
$this->setUpdatedAt($now);
$this->setCreatedAt($now);
}
public function preUpdate()
{
$now = new \DateTime('NOW');
$this->setUpdatedAt($now);
}
/**
* @var Application\Sonata\UserBundle\Entity\User
*/
private $createdBy;
/**
* Set createdBy
*
* @param Application\Sonata\UserBundle\Entity\User $createdBy
*/
public function setCreatedBy($createdBy)
{
$this->createdBy = $createdBy;
}
/**
* Get createdBy
*
* @return Application\Sonata\UserBundle\Entity\User
*/
public function getCreatedBy()
{
return $this->createdBy;
}
}