1
|
|
|
<?php |
2
|
|
|
/* |
3
|
|
|
* This file is part of the FreshSinchBundle |
4
|
|
|
* |
5
|
|
|
* (c) Artem Genvald <[email protected]> |
6
|
|
|
* |
7
|
|
|
* For the full copyright and license information, please view the LICENSE |
8
|
|
|
* file that was distributed with this source code. |
9
|
|
|
*/ |
10
|
|
|
|
11
|
|
|
namespace Fresh\SinchBundle\Event; |
12
|
|
|
|
13
|
|
|
use Fresh\SinchBundle\Model\CallbackRequest; |
14
|
|
|
use Fresh\SinchBundle\Model\Identity; |
15
|
|
|
use Symfony\Component\EventDispatcher\Event; |
16
|
|
|
|
17
|
|
|
/** |
18
|
|
|
* SmsMessageCallbackEvent. |
19
|
|
|
* |
20
|
|
|
* @author Artem Genvald <[email protected]> |
21
|
|
|
*/ |
22
|
|
|
class SmsMessageCallbackEvent extends Event |
23
|
|
|
{ |
24
|
|
|
/** |
25
|
|
|
* @var CallbackRequest $callbackRequest Callback request |
26
|
|
|
*/ |
27
|
|
|
private $callbackRequest; |
28
|
|
|
|
29
|
|
|
/** |
30
|
|
|
* Constructor. |
31
|
|
|
* |
32
|
|
|
* @param CallbackRequest $callbackRequest Callback request |
33
|
|
|
*/ |
34
|
|
|
public function __construct(CallbackRequest $callbackRequest) |
35
|
|
|
{ |
36
|
|
|
$this->callbackRequest = $callbackRequest; |
37
|
|
|
} |
38
|
|
|
|
39
|
|
|
/** |
40
|
|
|
* Get event. |
41
|
|
|
* |
42
|
|
|
* @return string Event |
43
|
|
|
*/ |
44
|
|
|
public function getEvent() |
45
|
|
|
{ |
46
|
|
|
return $this->callbackRequest->getEvent(); |
47
|
|
|
} |
48
|
|
|
|
49
|
|
|
/** |
50
|
|
|
* Get to. |
51
|
|
|
* |
52
|
|
|
* @return Identity To |
53
|
|
|
*/ |
54
|
|
|
public function getTo() |
55
|
|
|
{ |
56
|
|
|
return $this->callbackRequest->getTo(); |
57
|
|
|
} |
58
|
|
|
|
59
|
|
|
/** |
60
|
|
|
* Get from. |
61
|
|
|
* |
62
|
|
|
* @return Identity From |
63
|
|
|
*/ |
64
|
|
|
public function getFrom() |
65
|
|
|
{ |
66
|
|
|
return $this->callbackRequest->getFrom(); |
67
|
|
|
} |
68
|
|
|
|
69
|
|
|
/** |
70
|
|
|
* Get message. |
71
|
|
|
* |
72
|
|
|
* @return string Message |
73
|
|
|
*/ |
74
|
|
|
public function getMessage() |
75
|
|
|
{ |
76
|
|
|
return $this->callbackRequest->getMessage(); |
77
|
|
|
} |
78
|
|
|
|
79
|
|
|
/** |
80
|
|
|
* Get timestamp. |
81
|
|
|
* |
82
|
|
|
* @return \DateTime Timestamp |
83
|
|
|
*/ |
84
|
|
|
public function getTimestamp() |
85
|
|
|
{ |
86
|
|
|
return $this->callbackRequest->getTimestamp(); |
87
|
|
|
} |
88
|
|
|
|
89
|
|
|
/** |
90
|
|
|
* Get version. |
91
|
|
|
* |
92
|
|
|
* @return int Version |
93
|
|
|
*/ |
94
|
|
|
public function getVersion() |
95
|
|
|
{ |
96
|
|
|
return $this->callbackRequest->getVersion(); |
97
|
|
|
} |
98
|
|
|
} |
99
|
|
|
|