1 | <?php |
||
14 | class MailEvent extends Event implements ResultAwareInterface |
||
15 | { |
||
16 | const EVENT_MAIL_PRE_SEND = 'event.mail.pre.send'; |
||
17 | const EVENT_MAIL_POST_SEND = 'event.mail.post.send'; |
||
18 | const EVENT_MAIL_SEND_ERROR = 'event.mail.send.error'; |
||
19 | |||
20 | /** |
||
21 | * @var MailServiceInterface |
||
22 | */ |
||
23 | protected $mailService; |
||
24 | /** |
||
25 | * @var ResultInterface |
||
26 | */ |
||
27 | protected $result; |
||
28 | |||
29 | 11 | public function __construct(MailServiceInterface $mailService, $name = self::EVENT_MAIL_PRE_SEND) |
|
30 | { |
||
31 | 11 | parent::__construct($name); |
|
32 | 11 | $this->mailService = $mailService; |
|
33 | 11 | } |
|
34 | |||
35 | /** |
||
36 | * @param $mailService |
||
37 | * @return $this |
||
38 | */ |
||
39 | 1 | public function setMailService($mailService) |
|
40 | { |
||
41 | 1 | $this->mailService = $mailService; |
|
42 | 1 | return $this; |
|
43 | } |
||
44 | /** |
||
45 | * @return \AcMailer\Service\MailServiceInterface |
||
46 | */ |
||
47 | 1 | public function getMailService() |
|
48 | { |
||
49 | 1 | return $this->mailService; |
|
50 | } |
||
51 | |||
52 | /** |
||
53 | * @param ResultInterface $result |
||
54 | * @return $this |
||
55 | */ |
||
56 | 10 | public function setResult(ResultInterface $result) |
|
57 | { |
||
58 | 10 | $this->result = $result; |
|
59 | 10 | return $this; |
|
60 | } |
||
61 | |||
62 | /** |
||
63 | * @return ResultInterface |
||
64 | */ |
||
65 | 1 | public function getResult() |
|
69 | } |
||
70 |