/
Message.php
70 lines (58 loc) · 1.28 KB
/
Message.php
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<?php
class Wildfire_Message
{
private $sender = null;
private $receiver = null;
private $data = null;
private $meta = null;
private $protocol = null;
public function setData($data)
{
if(!is_string($data)) {
throw new Exception('$data is not a string');
}
$this->data = $data;
return true;
}
public function getData()
{
return $this->data;
}
public function setMeta($meta)
{
if($meta!==false && $meta!==null) {
if(!is_string($meta)) {
throw new Exception('$meta is not a string');
}
}
$this->meta = $meta;
}
public function getMeta()
{
return $this->meta;
}
public function setProtocol($protocol)
{
$this->protocol = $protocol;
}
public function getProtocol()
{
return $this->protocol;
}
public function setSender($sender)
{
$this->sender = $sender;
}
public function getSender()
{
return $this->sender;
}
public function setReceiver($receiver)
{
$this->receiver = $receiver;
}
public function getReceiver()
{
return $this->receiver;
}
}