1 | <?php |
||
6 | class MailJob extends AbstractMailObject implements MailJobInterface |
||
7 | { |
||
8 | /** |
||
9 | * @var mixed |
||
10 | */ |
||
11 | private $id; |
||
12 | /** |
||
13 | * @var MailMessage|string |
||
14 | */ |
||
15 | private $message; |
||
16 | /** |
||
17 | * @var int number of attempts. Every time a mail fails to be sent, the number of attempts could be incremented. |
||
18 | * |
||
19 | * @see `incrementAttempt()` |
||
20 | */ |
||
21 | private $attempt = 0; |
||
22 | /** |
||
23 | * @var bool whether the job has been completed |
||
24 | */ |
||
25 | private $completed = false; |
||
26 | |||
27 | /** |
||
28 | * {@inheritdoc} |
||
29 | */ |
||
30 | 19 | public function __construct(array $config = []) |
|
34 | |||
35 | /** |
||
36 | * @return bool |
||
37 | */ |
||
38 | 15 | public function isNewRecord() |
|
42 | |||
43 | /** |
||
44 | * @return mixed |
||
45 | */ |
||
46 | 18 | public function getId() |
|
50 | |||
51 | /** |
||
52 | * @param mixed $id |
||
53 | */ |
||
54 | 14 | public function setId($id) |
|
58 | |||
59 | /** |
||
60 | * @return MailMessage|string |
||
61 | */ |
||
62 | 16 | public function getMessage() |
|
66 | |||
67 | /** |
||
68 | * @param MailMessage|string $message |
||
69 | */ |
||
70 | 19 | public function setMessage($message) |
|
74 | |||
75 | /** |
||
76 | * @return int |
||
77 | */ |
||
78 | 15 | public function getAttempt() |
|
82 | |||
83 | 14 | public function setAttempt($attempt) |
|
87 | |||
88 | /** |
||
89 | * Increments attempt by one. |
||
90 | */ |
||
91 | 1 | public function incrementAttempt() |
|
95 | |||
96 | 7 | public function markAsCompleted() |
|
100 | |||
101 | 10 | public function isCompleted() |
|
105 | } |
||
106 |