Total Complexity | 7 |
Total Lines | 34 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
7 | trait MessagePropertiesForPublish |
||
8 | { |
||
9 | public $messageBody; |
||
10 | public $messageAttributes; |
||
11 | |||
12 | public function getMessageBody() |
||
13 | { |
||
14 | return $this->messageBody; |
||
15 | } |
||
16 | |||
17 | public function setMessageBody($messageBody) |
||
18 | { |
||
19 | $this->messageBody = $messageBody; |
||
20 | } |
||
21 | |||
22 | public function getMessageAttributes() |
||
23 | { |
||
24 | return $this->messageAttributes; |
||
25 | } |
||
26 | |||
27 | public function setMessageAttributes($messageAttributes) |
||
28 | { |
||
29 | $this->messageAttributes = $messageAttributes; |
||
30 | } |
||
31 | |||
32 | public function writeMessagePropertiesForPublishXML(\XMLWriter $xmlWriter) |
||
33 | { |
||
34 | if ($this->messageBody != NULL) |
||
35 | { |
||
36 | $xmlWriter->writeElement(Constants::MESSAGE_BODY, $this->messageBody); |
||
37 | } |
||
38 | if ($this->messageAttributes !== NULL) |
||
39 | { |
||
40 | $this->messageAttributes->writeXML($xmlWriter); |
||
41 | } |
||
46 |