-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathinbound.class.php
More file actions
47 lines (37 loc) · 1.2 KB
/
inbound.class.php
File metadata and controls
47 lines (37 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php
/*
* Convenience class that parses inbound SMSified JSON into a simple object.
*/
class InboundMessage {
// Class properties.
protected $timeStamp;
protected $destinationAddress;
protected $message;
protected $messageId;
protected $senderAddress;
// Class constructor.
public function __construct($json) {
$notification = json_decode($json);
$this->timeStamp = $notification->inboundSMSMessageNotification->inboundSMSMessage->dateTime;
$this->destinationAddress = $notification->inboundSMSMessageNotification->inboundSMSMessage->destinationAddress;
$this->message = $notification->inboundSMSMessageNotification->inboundSMSMessage->message;
$this->messageId = $notification->inboundSMSMessageNotification->inboundSMSMessage->messageId;
$this->senderAddress = $notification->inboundSMSMessageNotification->inboundSMSMessage->senderAddress;
}
public function getTimeStamp() {
return $this->timeStamp;
}
public function getDestinationAddress() {
return $this->destinationAddress;
}
public function getMessage() {
return $this->message;
}
public function getMessageId() {
return $this->messageId;
}
public function getSenderAddress() {
return $this->senderAddress;
}
}
?>