1 | <?php |
||
14 | class Message |
||
15 | { |
||
16 | /** |
||
17 | * @var int |
||
18 | * |
||
19 | * @ORM\Column(name="id", type="integer", nullable=false) |
||
20 | * @ORM\Id |
||
21 | * @ORM\GeneratedValue(strategy="AUTO") |
||
22 | */ |
||
23 | private $id; |
||
24 | |||
25 | /** |
||
26 | * @ORM\ManyToOne(targetEntity="Queue") |
||
27 | */ |
||
28 | private $queue; |
||
29 | |||
30 | /** |
||
31 | * @var string |
||
32 | * |
||
33 | * @ORM\Column(name="handle", type="string", length=32, nullable=true) |
||
34 | */ |
||
35 | private $handle; |
||
36 | |||
37 | /** |
||
38 | * @var text |
||
39 | * |
||
40 | * @ORM\Column(name="body", type="text", nullable=false) |
||
41 | */ |
||
42 | private $body; |
||
43 | |||
44 | /** |
||
45 | * @var string |
||
46 | * |
||
47 | * @ORM\Column(name="md5", type="string", length=32, nullable=false) |
||
48 | */ |
||
49 | private $md5; |
||
50 | |||
51 | /** |
||
52 | * @var decimal |
||
53 | * |
||
54 | * @ORM\Column(name="timeout", type="decimal", nullable=true) |
||
55 | */ |
||
56 | private $timeout; |
||
57 | |||
58 | /** |
||
59 | * @var int |
||
60 | * |
||
61 | * @ORM\Column(name="created", type="integer", nullable=false) |
||
62 | */ |
||
63 | private $created; |
||
64 | |||
65 | /** |
||
66 | * @var smallint |
||
67 | * |
||
68 | * @ORM\Column(type = "smallint") |
||
69 | */ |
||
70 | private $priority = 0; |
||
71 | |||
72 | /** |
||
73 | * @var bool |
||
74 | * |
||
75 | * @ORM\Column(name="failed", type="boolean", nullable=false) |
||
76 | */ |
||
77 | private $failed; |
||
78 | |||
79 | /** |
||
80 | * @var int |
||
81 | * |
||
82 | * @ORM\Column(name="num_retries", type="integer", nullable=false) |
||
83 | */ |
||
84 | private $numRetries = 0; |
||
85 | |||
86 | /** |
||
87 | * @var bool |
||
88 | * |
||
89 | * @ORM\Column(name="ended", type="boolean", nullable=false) |
||
90 | */ |
||
91 | private $ended; |
||
92 | |||
93 | /** @ORM\PrePersist */ |
||
94 | public function prePersist() |
||
99 | |||
100 | public function __toString() |
||
104 | |||
105 | /** |
||
106 | * Get messageId. |
||
107 | * |
||
108 | * @return int |
||
109 | */ |
||
110 | public function getId() |
||
114 | |||
115 | /** |
||
116 | * Set handle. |
||
117 | * |
||
118 | * @param string $handle |
||
119 | */ |
||
120 | public function setHandle($handle) |
||
124 | |||
125 | /** |
||
126 | * Get handle. |
||
127 | * |
||
128 | * @return string |
||
129 | */ |
||
130 | public function getHandle() |
||
134 | |||
135 | /** |
||
136 | * Set body. |
||
137 | * |
||
138 | * @param text $body |
||
139 | */ |
||
140 | public function setBody($body) |
||
144 | |||
145 | /** |
||
146 | * Get body. |
||
147 | * |
||
148 | * @return text |
||
149 | */ |
||
150 | public function getBody() |
||
154 | |||
155 | /** |
||
156 | * Set md5. |
||
157 | * |
||
158 | * @param string $md5 |
||
159 | */ |
||
160 | public function setMd5($md5) |
||
164 | |||
165 | /** |
||
166 | * Get md5. |
||
167 | * |
||
168 | * @return string |
||
169 | */ |
||
170 | public function getMd5() |
||
174 | |||
175 | /** |
||
176 | * Set timeout. |
||
177 | * |
||
178 | * @param decimal $timeout |
||
179 | */ |
||
180 | public function setTimeout($timeout) |
||
184 | |||
185 | /** |
||
186 | * Get timeout. |
||
187 | * |
||
188 | * @return decimal |
||
189 | */ |
||
190 | public function getTimeout() |
||
194 | |||
195 | /** |
||
196 | * Set created. |
||
197 | * |
||
198 | * @param int $created |
||
199 | */ |
||
200 | public function setCreated($created) |
||
204 | |||
205 | /** |
||
206 | * Get created. |
||
207 | * |
||
208 | * @return int |
||
209 | */ |
||
210 | public function getCreated() |
||
214 | |||
215 | /** |
||
216 | * Set priority. |
||
217 | * |
||
218 | * @param smallint $priority |
||
219 | */ |
||
220 | public function setPriority($priority) |
||
224 | |||
225 | /** |
||
226 | * Get pririty. |
||
227 | * |
||
228 | * @return pririty |
||
229 | */ |
||
230 | public function getPriority() |
||
234 | |||
235 | /** |
||
236 | * Set failed. |
||
237 | * |
||
238 | * @param bool $failed |
||
239 | */ |
||
240 | public function setFailed($failed) |
||
244 | |||
245 | /** |
||
246 | * Get failed. |
||
247 | * |
||
248 | * @return bool |
||
249 | */ |
||
250 | public function getFailed() |
||
254 | |||
255 | /** |
||
256 | * Set ended. |
||
257 | * |
||
258 | * @param bool $ended |
||
259 | */ |
||
260 | public function setEnded($ended) |
||
264 | |||
265 | /** |
||
266 | * Get ended. |
||
267 | * |
||
268 | * @return bool |
||
269 | */ |
||
270 | public function getEnded() |
||
274 | |||
275 | public function toArray() |
||
279 | |||
280 | /** |
||
281 | * Set queue. |
||
282 | * |
||
283 | * @param \Heri\Bundle\JobQueueBundle\Entity\Queue $queue |
||
284 | * |
||
285 | * @return Message |
||
286 | */ |
||
287 | public function setQueue(\Heri\Bundle\JobQueueBundle\Entity\Queue $queue = null) |
||
293 | |||
294 | /** |
||
295 | * Get queue. |
||
296 | * |
||
297 | * @return \Heri\Bundle\JobQueueBundle\Entity\Queue |
||
298 | */ |
||
299 | public function getQueue() |
||
303 | |||
304 | /** |
||
305 | * @return int |
||
306 | */ |
||
307 | public function getNumRetries() |
||
311 | |||
312 | /** |
||
313 | * @param int $numRetries |
||
314 | */ |
||
315 | public function setNumRetries($numRetries) |
||
319 | } |
||
320 |