You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
46 lines
976 B
46 lines
976 B
<?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);
|
|
}
|
|
}
|
|
}
|
|
|
|
?>
|