1 | <?php |
||
5 | class Message |
||
6 | { |
||
7 | /** |
||
8 | * @var string |
||
9 | */ |
||
10 | private $id; |
||
11 | |||
12 | /** |
||
13 | * @var string |
||
14 | */ |
||
15 | private $body; |
||
16 | |||
17 | /** |
||
18 | * @var MessageProperties |
||
19 | */ |
||
20 | private $properties; |
||
21 | |||
22 | /** |
||
23 | * @var string |
||
24 | */ |
||
25 | private $routingKey; |
||
26 | |||
27 | /** |
||
28 | * @param string $id |
||
29 | * @param string $body |
||
30 | * @param MessageProperties|null $properties |
||
31 | * @param string|null $routingKey |
||
32 | */ |
||
33 | 18 | public function __construct($body, MessageProperties $properties = null, $id = null, $routingKey = null) |
|
40 | |||
41 | /** |
||
42 | * Resets id and deep-clones properties. |
||
43 | */ |
||
44 | public function __clone() |
||
49 | |||
50 | /** |
||
51 | * @return string |
||
52 | */ |
||
53 | 4 | public function getId() |
|
57 | |||
58 | /** |
||
59 | * @param string $body |
||
60 | */ |
||
61 | 1 | public function setBody($body) |
|
65 | |||
66 | /** |
||
67 | * @return string |
||
68 | */ |
||
69 | 12 | public function getBody() |
|
73 | |||
74 | /** |
||
75 | * @param MessageProperties $properties |
||
76 | */ |
||
77 | 1 | public function setProperties($properties) |
|
81 | |||
82 | /** |
||
83 | * @return MessageProperties |
||
84 | */ |
||
85 | 7 | public function getProperties() |
|
89 | |||
90 | /** |
||
91 | * @param string $routingKey |
||
92 | */ |
||
93 | 2 | public function setRoutingKey($routingKey) |
|
97 | |||
98 | /** |
||
99 | * @return string |
||
100 | */ |
||
101 | 8 | public function getRoutingKey() |
|
105 | |||
106 | /** |
||
107 | * @param string $contentType |
||
108 | */ |
||
109 | 1 | public function setContentType($contentType) |
|
113 | |||
114 | /** |
||
115 | * @return string |
||
116 | */ |
||
117 | 2 | public function getContentType() |
|
121 | |||
122 | /** |
||
123 | * @param int $deliveryMode |
||
124 | */ |
||
125 | 1 | public function setDeliveryMode($deliveryMode) |
|
129 | |||
130 | /** |
||
131 | * @return int |
||
132 | */ |
||
133 | 2 | public function getDeliveryMode() |
|
137 | |||
138 | /** |
||
139 | * @param int $priority |
||
140 | */ |
||
141 | 8 | public function setPriority($priority) |
|
145 | |||
146 | /** |
||
147 | * @return int |
||
148 | */ |
||
149 | 3 | public function getPriority() |
|
153 | |||
154 | /** |
||
155 | * @param int $timestamp |
||
156 | */ |
||
157 | public function setTimestamp($timestamp) |
||
161 | |||
162 | /** |
||
163 | * @return int |
||
164 | */ |
||
165 | public function getTimestamp() |
||
169 | |||
170 | /** |
||
171 | * @param string $name |
||
172 | * @param mixed $value |
||
173 | */ |
||
174 | 2 | public function setHeader($name, $value) |
|
181 | |||
182 | /** |
||
183 | * Get a specific message header. |
||
184 | * |
||
185 | * @param string $name Name of the header to get the value from. |
||
186 | * |
||
187 | * @return string|bool The contents of the specified header or false if not set. |
||
188 | */ |
||
189 | 3 | public function getHeader($name) |
|
199 | |||
200 | /** |
||
201 | * Get the headers of the message. |
||
202 | * |
||
203 | * @return array An array of key value pairs associated with the message. |
||
204 | */ |
||
205 | 4 | public function getHeaders() |
|
213 | } |
||
214 |