LiveChannelListInfo.php 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. <?php
  2. namespace OSS\Model;
  3. /**
  4. * Class LiveChannelListInfo
  5. *
  6. * The data returned by ListBucketLiveChannels
  7. *
  8. * @package OSS\Model
  9. * @link http://help.aliyun.com/document_detail/oss/api-reference/bucket/GetBucket.html
  10. */
  11. class LiveChannelListInfo implements XmlConfig
  12. {
  13. /**
  14. * @return string
  15. */
  16. public function getBucketName()
  17. {
  18. return $this->bucket;
  19. }
  20. public function setBucketName($name)
  21. {
  22. $this->bucket = $name;
  23. }
  24. /**
  25. * @return string
  26. */
  27. public function getPrefix()
  28. {
  29. return $this->prefix;
  30. }
  31. /**
  32. * @return string
  33. */
  34. public function getMarker()
  35. {
  36. return $this->marker;
  37. }
  38. /**
  39. * @return int
  40. */
  41. public function getMaxKeys()
  42. {
  43. return $this->maxKeys;
  44. }
  45. /**
  46. * @return mixed
  47. */
  48. public function getIsTruncated()
  49. {
  50. return $this->isTruncated;
  51. }
  52. /**
  53. * @return LiveChannelInfo[]
  54. */
  55. public function getChannelList()
  56. {
  57. return $this->channelList;
  58. }
  59. /**
  60. * @return string
  61. */
  62. public function getNextMarker()
  63. {
  64. return $this->nextMarker;
  65. }
  66. public function parseFromXml($strXml)
  67. {
  68. $xml = simplexml_load_string($strXml);
  69. $this->prefix = strval($xml->Prefix);
  70. $this->marker = strval($xml->Marker);
  71. $this->maxKeys = intval($xml->MaxKeys);
  72. $this->isTruncated = (strval($xml->IsTruncated) == 'true');
  73. $this->nextMarker = strval($xml->NextMarker);
  74. if (isset($xml->LiveChannel)) {
  75. foreach ($xml->LiveChannel as $chan) {
  76. $channel = new LiveChannelInfo();
  77. $channel->parseFromXmlNode($chan);
  78. $this->channelList[] = $channel;
  79. }
  80. }
  81. }
  82. public function serializeToXml()
  83. {
  84. throw new OssException("Not implemented.");
  85. }
  86. private $bucket = '';
  87. private $prefix = '';
  88. private $marker = '';
  89. private $nextMarker = '';
  90. private $maxKeys = 100;
  91. private $isTruncated = 'false';
  92. private $channelList = array();
  93. }