|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace Uecode\Bundle\QPushBundle\Entity; |
|
4
|
|
|
|
|
5
|
|
|
use Doctrine\ORM\Mapping as ORM; |
|
6
|
|
|
use Doctrine\ORM\Mapping\Index as Index; |
|
7
|
|
|
use Gedmo\Mapping\Annotation as Gedmo; |
|
8
|
|
|
|
|
9
|
|
|
/** |
|
10
|
|
|
* @ORM\Entity |
|
11
|
|
|
* @ORM\Table(name="uecode_qpush_message", |
|
12
|
|
|
* indexes={@ORM\Index(name="uecode_qpush_queue_idx",columns={"queue"}), |
|
13
|
|
|
* @ORM\Index(name="uecode_qpush_delivered_idx",columns={"delivered"})}) |
|
14
|
|
|
*/ |
|
15
|
|
|
class DoctrineMessage { |
|
16
|
|
|
/** |
|
17
|
|
|
* @ORM\Id |
|
18
|
|
|
* @ORM\GeneratedValue |
|
19
|
|
|
* @ORM\Column(type="integer") |
|
20
|
|
|
*/ |
|
21
|
|
|
private $id; |
|
22
|
|
|
|
|
23
|
|
|
/** |
|
24
|
|
|
* @var \DateTime $created |
|
25
|
|
|
* |
|
26
|
|
|
* @Gedmo\Timestampable(on="create") |
|
27
|
|
|
* @ORM\Column(type="datetime") |
|
28
|
|
|
*/ |
|
29
|
|
|
private $created; |
|
30
|
|
|
|
|
31
|
|
|
/** |
|
32
|
|
|
* @var \DateTime $updated |
|
33
|
|
|
* |
|
34
|
|
|
* @Gedmo\Timestampable(on="update") |
|
35
|
|
|
* @ORM\Column(type="datetime") |
|
36
|
|
|
*/ |
|
37
|
|
|
private $updated; |
|
38
|
|
|
|
|
39
|
|
|
/** |
|
40
|
|
|
* |
|
41
|
|
|
* @ORM\Column(type="string") |
|
42
|
|
|
*/ |
|
43
|
|
|
private $queue; |
|
44
|
|
|
|
|
45
|
|
|
/** |
|
46
|
|
|
* |
|
47
|
|
|
* @ORM\Column(type="boolean") |
|
48
|
|
|
*/ |
|
49
|
|
|
private $delivered; |
|
50
|
|
|
|
|
51
|
|
|
/** |
|
52
|
|
|
* |
|
53
|
|
|
* @ORM\Column(type="array") |
|
54
|
|
|
*/ |
|
55
|
|
|
private $message; |
|
56
|
|
|
|
|
57
|
|
|
/** |
|
58
|
|
|
* @ORM\Column(type="integer") |
|
59
|
|
|
*/ |
|
60
|
|
|
private $length; |
|
61
|
|
|
|
|
62
|
|
|
/** |
|
63
|
|
|
* Get id |
|
64
|
|
|
* |
|
65
|
|
|
* @return integer |
|
66
|
|
|
*/ |
|
67
|
|
|
public function getId() |
|
68
|
|
|
{ |
|
69
|
|
|
return $this->id; |
|
70
|
|
|
} |
|
71
|
|
|
|
|
72
|
|
|
/** |
|
73
|
|
|
* Set message |
|
74
|
|
|
* |
|
75
|
|
|
* @param array $message |
|
76
|
|
|
* |
|
77
|
|
|
* @return DoctrineMessage |
|
78
|
|
|
*/ |
|
79
|
|
|
public function setMessage($message) |
|
80
|
|
|
{ |
|
81
|
|
|
$this->message = $message; |
|
82
|
|
|
|
|
83
|
|
|
return $this; |
|
84
|
|
|
} |
|
85
|
|
|
|
|
86
|
|
|
/** |
|
87
|
|
|
* Get message |
|
88
|
|
|
* |
|
89
|
|
|
* @return array |
|
90
|
|
|
*/ |
|
91
|
|
|
public function getMessage() |
|
92
|
|
|
{ |
|
93
|
|
|
return $this->message; |
|
94
|
|
|
} |
|
95
|
|
|
|
|
96
|
|
|
/** |
|
97
|
|
|
* Set queue |
|
98
|
|
|
* |
|
99
|
|
|
* @param string $queue |
|
100
|
|
|
* |
|
101
|
|
|
* @return DoctrineMessage |
|
102
|
|
|
*/ |
|
103
|
|
|
public function setQueue($queue) |
|
104
|
|
|
{ |
|
105
|
|
|
$this->queue = $queue; |
|
106
|
|
|
|
|
107
|
|
|
return $this; |
|
108
|
|
|
} |
|
109
|
|
|
|
|
110
|
|
|
/** |
|
111
|
|
|
* Get queue |
|
112
|
|
|
* |
|
113
|
|
|
* @return string |
|
114
|
|
|
*/ |
|
115
|
|
|
public function getQueue() |
|
116
|
|
|
{ |
|
117
|
|
|
return $this->queue; |
|
118
|
|
|
} |
|
119
|
|
|
|
|
120
|
|
|
/** |
|
121
|
|
|
* Set delivered |
|
122
|
|
|
* |
|
123
|
|
|
* @param boolean $delivered |
|
124
|
|
|
* |
|
125
|
|
|
* @return DoctrineMessage |
|
126
|
|
|
*/ |
|
127
|
|
|
public function setDelivered($delivered) |
|
128
|
|
|
{ |
|
129
|
|
|
$this->delivered = $delivered; |
|
130
|
|
|
|
|
131
|
|
|
return $this; |
|
132
|
|
|
} |
|
133
|
|
|
|
|
134
|
|
|
/** |
|
135
|
|
|
* Get delivered |
|
136
|
|
|
* |
|
137
|
|
|
* @return boolean |
|
138
|
|
|
*/ |
|
139
|
|
|
public function getDelivered() |
|
140
|
|
|
{ |
|
141
|
|
|
return $this->delivered; |
|
142
|
|
|
} |
|
143
|
|
|
|
|
144
|
|
|
/** |
|
145
|
|
|
* Set created |
|
146
|
|
|
* |
|
147
|
|
|
* @param \DateTime $created |
|
148
|
|
|
* |
|
149
|
|
|
* @return DoctrineMessage |
|
150
|
|
|
*/ |
|
151
|
|
|
public function setCreated($created) |
|
152
|
|
|
{ |
|
153
|
|
|
$this->created = $created; |
|
154
|
|
|
|
|
155
|
|
|
return $this; |
|
156
|
|
|
} |
|
157
|
|
|
|
|
158
|
|
|
/** |
|
159
|
|
|
* Get created |
|
160
|
|
|
* |
|
161
|
|
|
* @return \DateTime |
|
162
|
|
|
*/ |
|
163
|
|
|
public function getCreated() |
|
164
|
|
|
{ |
|
165
|
|
|
return $this->created; |
|
166
|
|
|
} |
|
167
|
|
|
|
|
168
|
|
|
/** |
|
169
|
|
|
* Set updated |
|
170
|
|
|
* |
|
171
|
|
|
* @param \DateTime $updated |
|
172
|
|
|
* |
|
173
|
|
|
* @return DoctrineMessage |
|
174
|
|
|
*/ |
|
175
|
|
|
public function setUpdated($updated) |
|
176
|
|
|
{ |
|
177
|
|
|
$this->updated = $updated; |
|
178
|
|
|
|
|
179
|
|
|
return $this; |
|
180
|
|
|
} |
|
181
|
|
|
|
|
182
|
|
|
/** |
|
183
|
|
|
* Get updated |
|
184
|
|
|
* |
|
185
|
|
|
* @return \DateTime |
|
186
|
|
|
*/ |
|
187
|
|
|
public function getUpdated() |
|
188
|
|
|
{ |
|
189
|
|
|
return $this->updated; |
|
190
|
|
|
} |
|
191
|
|
|
|
|
192
|
|
|
/** |
|
193
|
|
|
* Set length |
|
194
|
|
|
* |
|
195
|
|
|
* @param integer $length |
|
196
|
|
|
* |
|
197
|
|
|
* @return DoctrineMessage |
|
198
|
|
|
*/ |
|
199
|
|
|
public function setLength($length) |
|
200
|
|
|
{ |
|
201
|
|
|
$this->length = $length; |
|
202
|
|
|
|
|
203
|
|
|
return $this; |
|
204
|
|
|
} |
|
205
|
|
|
|
|
206
|
|
|
/** |
|
207
|
|
|
* Get length |
|
208
|
|
|
* |
|
209
|
|
|
* @return integer |
|
210
|
|
|
*/ |
|
211
|
|
|
public function getLength() |
|
212
|
|
|
{ |
|
213
|
|
|
return $this->length; |
|
214
|
|
|
} |
|
215
|
|
|
} |
|
216
|
|
|
|