Geen omschrijving

AccountAttributes.php 1.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <?php
  2. namespace AliyunMNS\Model;
  3. use AliyunMNS\Constants;
  4. /**
  5. * Please refer to
  6. * https://docs.aliyun.com/?spm=#/pub/mns/api_reference/intro&intro
  7. * for more details
  8. */
  9. class AccountAttributes
  10. {
  11. private $loggingBucket;
  12. public function __construct(
  13. $loggingBucket = NULL)
  14. {
  15. $this->loggingBucket = $loggingBucket;
  16. }
  17. public function setLoggingBucket($loggingBucket)
  18. {
  19. $this->loggingBucket = $loggingBucket;
  20. }
  21. public function getLoggingBucket()
  22. {
  23. return $this->loggingBucket;
  24. }
  25. public function writeXML(\XMLWriter $xmlWriter)
  26. {
  27. if ($this->loggingBucket !== NULL)
  28. {
  29. $xmlWriter->writeElement(Constants::LOGGING_BUCKET, $this->loggingBucket);
  30. }
  31. }
  32. static public function fromXML(\XMLReader $xmlReader)
  33. {
  34. $loggingBucket = NULL;
  35. while ($xmlReader->read())
  36. {
  37. if ($xmlReader->nodeType == \XMLReader::ELEMENT)
  38. {
  39. switch ($xmlReader->name) {
  40. case 'LoggingBucket':
  41. $xmlReader->read();
  42. if ($xmlReader->nodeType == \XMLReader::TEXT)
  43. {
  44. $loggingBucket = $xmlReader->value;
  45. }
  46. break;
  47. }
  48. }
  49. }
  50. $attributes = new AccountAttributes($loggingBucket);
  51. return $attributes;
  52. }
  53. }
  54. ?>