|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
/* |
|
4
|
|
|
* This file is part of the smsmode-bundle package. |
|
5
|
|
|
* |
|
6
|
|
|
* (c) 2019 WEBEWEB |
|
7
|
|
|
* |
|
8
|
|
|
* For the full copyright and license information, please view the LICENSE |
|
9
|
|
|
* file that was distributed with this source code. |
|
10
|
|
|
*/ |
|
11
|
|
|
|
|
12
|
|
|
namespace WBW\Bundle\SmsModeBundle\Event; |
|
13
|
|
|
|
|
14
|
|
|
use WBW\Library\SmsMode\Entity\SendingSmsMessageInterface; |
|
15
|
|
|
use WBW\Library\SmsMode\Request\SendingSmsMessageRequest; |
|
16
|
|
|
use WBW\Library\SmsMode\Response\SendingSmsMessageResponse; |
|
17
|
|
|
|
|
18
|
|
|
/** |
|
19
|
|
|
* Sending SMS message event. |
|
20
|
|
|
* |
|
21
|
|
|
* @author webeweb <https://github.com/webeweb> |
|
22
|
|
|
* @package WBW\Bundle\SmsModeBundle\Event |
|
23
|
|
|
*/ |
|
24
|
|
|
class SendingSmsMessageEvent extends AbstractEvent { |
|
25
|
|
|
|
|
26
|
|
|
/** |
|
27
|
|
|
* Event name. |
|
28
|
|
|
* |
|
29
|
|
|
* @var string |
|
30
|
|
|
*/ |
|
31
|
|
|
const EVENT_NAME = "wbw.smsmode.event.sending_sms_message"; |
|
32
|
|
|
|
|
33
|
|
|
/** |
|
34
|
|
|
* Constructor. |
|
35
|
|
|
* |
|
36
|
|
|
* @param SendingSmsMessageInterface $sendingSmsMessage The sending SMS message. |
|
37
|
|
|
*/ |
|
38
|
|
|
public function __construct(SendingSmsMessageInterface $sendingSmsMessage) { |
|
39
|
|
|
parent::__construct(self::EVENT_NAME, $sendingSmsMessage); |
|
40
|
|
|
} |
|
41
|
|
|
|
|
42
|
|
|
/** |
|
43
|
|
|
* Get the sending SMS message request. |
|
44
|
|
|
* |
|
45
|
|
|
* @return SendingSmsMessageRequest|null Returns the sending SMS message request. |
|
46
|
|
|
*/ |
|
47
|
|
|
public function getRequest(): ?SendingSmsMessageRequest { |
|
48
|
|
|
return parent::getRequest(); |
|
|
|
|
|
|
49
|
|
|
} |
|
50
|
|
|
|
|
51
|
|
|
/** |
|
52
|
|
|
* Get the sending SMS message response. |
|
53
|
|
|
* |
|
54
|
|
|
* @return SendingSmsMessageResponse|null Returns the sending SMS message response. |
|
55
|
|
|
*/ |
|
56
|
|
|
public function getResponse(): ?SendingSmsMessageResponse { |
|
57
|
|
|
return parent::getResponse(); |
|
|
|
|
|
|
58
|
|
|
} |
|
59
|
|
|
|
|
60
|
|
|
/** |
|
61
|
|
|
* Get the sending SMS message. |
|
62
|
|
|
* |
|
63
|
|
|
* @return SendingSmsMessageInterface|null Returns the sending SMS message. |
|
64
|
|
|
*/ |
|
65
|
|
|
public function getSendingSmsMessage(): ?SendingSmsMessageInterface { |
|
66
|
|
|
return $this->getEntity(); |
|
|
|
|
|
|
67
|
|
|
} |
|
68
|
|
|
} |
|
69
|
|
|
|