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\Bundle\CoreBundle\Event\AbstractEvent; |
15
|
|
|
use WBW\Library\SMSMode\Model\AbstractRequest; |
16
|
|
|
use WBW\Library\SMSMode\Model\AbstractResponse; |
17
|
|
|
|
18
|
|
|
/** |
19
|
|
|
* Abstract response event. |
20
|
|
|
* |
21
|
|
|
* @author webeweb <https://github.com/webeweb/> |
22
|
|
|
* @package WBW\Bundle\SMSModeBundle\Event |
23
|
|
|
* @abstract |
24
|
|
|
*/ |
25
|
|
|
abstract class AbstractResponseEvent extends AbstractEvent { |
26
|
|
|
|
27
|
|
|
/** |
28
|
|
|
* Request. |
29
|
|
|
* |
30
|
|
|
* @var AbstractRequest |
31
|
|
|
*/ |
32
|
|
|
private $request; |
33
|
|
|
|
34
|
|
|
/** |
35
|
|
|
* Response. |
36
|
|
|
* |
37
|
|
|
* @var AbstractResponse |
38
|
|
|
*/ |
39
|
|
|
private $response; |
40
|
|
|
|
41
|
|
|
/** |
42
|
|
|
* Constructor. |
43
|
|
|
* |
44
|
|
|
* @param string $eventName The event name. |
45
|
|
|
*/ |
46
|
|
|
protected function __construct($eventName) { |
47
|
|
|
parent::__construct($eventName); |
48
|
|
|
} |
49
|
|
|
|
50
|
|
|
/** |
51
|
|
|
* Get the request. |
52
|
|
|
* |
53
|
|
|
* @return AbstractRequest Returns the request. |
54
|
|
|
*/ |
55
|
|
|
protected function getRequest() { |
56
|
|
|
return $this->request; |
57
|
|
|
} |
58
|
|
|
|
59
|
|
|
/** |
60
|
|
|
* Get the response. |
61
|
|
|
* |
62
|
|
|
* @return AbstractResponse Returns the response. |
63
|
|
|
*/ |
64
|
|
|
protected function getResponse() { |
65
|
|
|
return $this->response; |
66
|
|
|
} |
67
|
|
|
|
68
|
|
|
/** |
69
|
|
|
* Set the request. |
70
|
|
|
* |
71
|
|
|
* @param AbstractRequest $request The request. |
72
|
|
|
* @return AbstractResponseEvent Returns this request event. |
73
|
|
|
*/ |
74
|
|
|
public function setRequest(AbstractRequest $request) { |
75
|
|
|
$this->request = $request; |
76
|
|
|
return $this; |
77
|
|
|
} |
78
|
|
|
|
79
|
|
|
/** |
80
|
|
|
* Set the response. |
81
|
|
|
* |
82
|
|
|
* @param AbstractResponse $response The response. |
83
|
|
|
* @return AbstractResponseEvent Returns this response event. |
84
|
|
|
*/ |
85
|
|
|
public function setResponse(AbstractResponse $response) { |
86
|
|
|
$this->response = $response; |
87
|
|
|
return $this; |
88
|
|
|
} |
89
|
|
|
} |
90
|
|
|
|