1 | <?php |
||
13 | class Job |
||
14 | { |
||
15 | /** |
||
16 | * Unique job id |
||
17 | * |
||
18 | * @var string|int |
||
19 | */ |
||
20 | protected $id; |
||
21 | |||
22 | /** |
||
23 | * Job attempts |
||
24 | * |
||
25 | * @var int |
||
26 | */ |
||
27 | protected $attempts; |
||
28 | |||
29 | /** |
||
30 | * Name of job's queue |
||
31 | * |
||
32 | * @var string |
||
33 | */ |
||
34 | protected $queue; |
||
35 | |||
36 | /** |
||
37 | * Job reserved flag |
||
38 | * |
||
39 | * @var bool |
||
40 | */ |
||
41 | protected $reserved; |
||
42 | |||
43 | /** |
||
44 | * Job reserved at time |
||
45 | * |
||
46 | * @var int |
||
47 | */ |
||
48 | protected $reservedAt; |
||
49 | |||
50 | /** |
||
51 | * Job's payload data |
||
52 | * |
||
53 | * @var array |
||
54 | */ |
||
55 | protected $payload = []; |
||
56 | |||
57 | /** |
||
58 | * @return int|string |
||
59 | */ |
||
60 | public function getId() |
||
64 | |||
65 | /** |
||
66 | * @param int|string $id |
||
67 | */ |
||
68 | public function setId($id) |
||
72 | |||
73 | /** |
||
74 | * @return int |
||
75 | */ |
||
76 | public function getAttempts(): int |
||
80 | |||
81 | /** |
||
82 | * @param int $attempts |
||
83 | */ |
||
84 | public function setAttempts(int $attempts) |
||
88 | |||
89 | /** |
||
90 | * @return string |
||
91 | */ |
||
92 | public function getQueue(): string |
||
96 | |||
97 | /** |
||
98 | * @param string $queue |
||
99 | */ |
||
100 | public function setQueue(string $queue) |
||
104 | |||
105 | /** |
||
106 | * @return bool |
||
107 | */ |
||
108 | public function isReserved(): bool |
||
112 | |||
113 | /** |
||
114 | * @param bool $reserved |
||
115 | */ |
||
116 | public function setReserved(bool $reserved) |
||
120 | |||
121 | /** |
||
122 | * @return int|null |
||
123 | */ |
||
124 | public function getReservedAt(): ?int |
||
128 | |||
129 | /** |
||
130 | * @param int|null $reservedAt |
||
131 | */ |
||
132 | public function setReservedAt(?int $reservedAt) |
||
136 | |||
137 | /** |
||
138 | * @return array |
||
139 | */ |
||
140 | public function getPayload(): array |
||
144 | |||
145 | /** |
||
146 | * @param array $payload |
||
147 | */ |
||
148 | public function setPayload(array $payload) |
||
152 | } |
||
153 |