12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- <?php
- namespace AliyunMNS\Traits;
- use AliyunMNS\Constants;
- use AliyunMNS\Model\MessageAttributes;
- trait MessagePropertiesForPublish
- {
- public $messageBody;
- public $messageAttributes;
- public function getMessageBody()
- {
- return $this->messageBody;
- }
- public function setMessageBody($messageBody)
- {
- $this->messageBody = $messageBody;
- }
- public function getMessageAttributes()
- {
- return $this->messageAttributes;
- }
- public function setMessageAttributes($messageAttributes)
- {
- $this->messageAttributes = $messageAttributes;
- }
- public function writeMessagePropertiesForPublishXML(\XMLWriter $xmlWriter)
- {
- if ($this->messageBody != NULL)
- {
- $xmlWriter->writeElement(Constants::MESSAGE_BODY, $this->messageBody);
- }
- if ($this->messageAttributes !== NULL)
- {
- $this->messageAttributes->writeXML($xmlWriter);
- }
- }
- }
- ?>
|