1 | <?php |
||
18 | class JobQueue extends DataObject |
||
19 | { |
||
20 | /* |
||
21 | * Status workflow is this: |
||
22 | * |
||
23 | * 1) Ready. The job has been added to the queue |
||
24 | * 1) Waiting. The job has been picked up by the worker |
||
25 | * 2) Running. The job is actively being processed. |
||
26 | * 3) Complete / Failed. The job has been processed |
||
27 | * |
||
28 | */ |
||
29 | const STATUS_READY = 'ready'; |
||
30 | const STATUS_WAITING = 'waiting'; |
||
31 | const STATUS_RUNNING = 'running'; |
||
32 | const STATUS_COMPLETE = 'complete'; |
||
33 | const STATUS_CANCELLED = 'cancelled'; |
||
34 | const STATUS_FAILED = 'failed'; |
||
35 | const STATUS_HELD = 'held'; |
||
36 | |||
37 | /** @var string */ |
||
38 | private $task; |
||
39 | /** @var int */ |
||
40 | private $user; |
||
41 | /** @var int */ |
||
42 | private $request; |
||
43 | /** @var int */ |
||
44 | private $emailtemplate; |
||
45 | /** @var string */ |
||
46 | private $status; |
||
47 | /** @var string */ |
||
48 | private $enqueue; |
||
49 | /** @var string */ |
||
50 | private $parameters; |
||
51 | /** @var string */ |
||
52 | private $error; |
||
53 | /** @var int */ |
||
54 | private $acknowledged; |
||
55 | /** @var int */ |
||
56 | private $parent; |
||
57 | |||
58 | /** |
||
59 | * This feels like the least bad place to put this method. |
||
60 | */ |
||
61 | public static function getTaskDescriptions() { |
||
68 | |||
69 | /** |
||
70 | * Saves a data object to the database, either updating or inserting a record. |
||
71 | * @return void |
||
72 | * @throws Exception |
||
73 | * @throws OptimisticLockFailedException |
||
74 | */ |
||
75 | public function save() |
||
128 | |||
129 | #region Properties |
||
130 | |||
131 | /** |
||
132 | * @return string |
||
133 | */ |
||
134 | public function getTask() |
||
138 | |||
139 | /** |
||
140 | * @param string $task |
||
141 | */ |
||
142 | public function setTask($task) |
||
146 | |||
147 | /** |
||
148 | * @return int |
||
149 | */ |
||
150 | public function getTriggerUserId() |
||
154 | |||
155 | /** |
||
156 | * @param int $user |
||
157 | */ |
||
158 | public function setTriggerUserId($user) |
||
162 | |||
163 | /** |
||
164 | * @return int |
||
165 | */ |
||
166 | public function getRequest() |
||
170 | |||
171 | /** |
||
172 | * @param int $request |
||
173 | */ |
||
174 | public function setRequest($request) |
||
178 | |||
179 | /** |
||
180 | * @return string |
||
181 | */ |
||
182 | public function getStatus() |
||
186 | |||
187 | /** |
||
188 | * @param string $status |
||
189 | */ |
||
190 | public function setStatus($status) |
||
194 | |||
195 | /** |
||
196 | * @return string |
||
197 | */ |
||
198 | public function getEnqueue() |
||
202 | |||
203 | /** |
||
204 | * @param string $enqueue |
||
205 | */ |
||
206 | public function setEnqueue($enqueue) |
||
210 | |||
211 | /** |
||
212 | * @return string |
||
213 | */ |
||
214 | public function getParameters() |
||
218 | |||
219 | /** |
||
220 | * @param string $parameters |
||
221 | */ |
||
222 | public function setParameters($parameters) |
||
226 | |||
227 | /** |
||
228 | * @return mixed |
||
|
|||
229 | */ |
||
230 | public function getError() |
||
234 | |||
235 | /** |
||
236 | * @param mixed $error |
||
237 | */ |
||
238 | public function setError($error) |
||
242 | |||
243 | /** |
||
244 | * @return int |
||
245 | */ |
||
246 | public function getAcknowledged() |
||
250 | |||
251 | /** |
||
252 | * @param int $acknowledged |
||
253 | */ |
||
254 | public function setAcknowledged($acknowledged) |
||
258 | |||
259 | /** |
||
260 | * @return int |
||
261 | */ |
||
262 | public function getParent() |
||
266 | |||
267 | /** |
||
268 | * @param int $parent |
||
269 | */ |
||
270 | public function setParent($parent) |
||
274 | |||
275 | /** |
||
276 | * @return int |
||
277 | */ |
||
278 | public function getEmailTemplate() |
||
282 | |||
283 | /** |
||
284 | * @param int $emailTemplate |
||
285 | */ |
||
286 | public function setEmailTemplate($emailTemplate) |
||
290 | #endregion |
||
291 | } |
This check looks for the generic type
array
as a return type and suggests a more specific type. This type is inferred from the actual code.