Nav apraksta

WebSocketAttributes.php 718B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. namespace AliyunMNS\Model;
  3. use AliyunMNS\Constants;
  4. use AliyunMNS\Exception\MnsException;
  5. class WebSocketAttributes
  6. {
  7. public $importanceLevel;
  8. public function __construct($importanceLevel)
  9. {
  10. $this->importanceLevel = $importanceLevel;
  11. }
  12. public function setImportanceLevel($importanceLevel)
  13. {
  14. $this->importanceLevel = $importanceLevel;
  15. }
  16. public function getImportanceLevel()
  17. {
  18. return $this->importanceLevel;
  19. }
  20. public function writeXML(\XMLWriter $xmlWriter)
  21. {
  22. $jsonArray = array(Constants::IMPORTANCE_LEVEL => $this->importanceLevel);
  23. $xmlWriter->writeElement(Constants::WEBSOCKET, json_encode($jsonArray));
  24. }
  25. }
  26. ?>