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.

73 lines
1.5 KiB

6 years ago
  1. <?php
  2. namespace OSS\Model;
  3. /**
  4. * Class StorageCapacityConfig
  5. *
  6. * @package OSS\Model
  7. * @link http://docs.alibaba-inc.com/pages/viewpage.action?pageId=271614763
  8. */
  9. class StorageCapacityConfig implements XmlConfig
  10. {
  11. /**
  12. * StorageCapacityConfig constructor.
  13. *
  14. * @param int $storageCapacity
  15. */
  16. public function __construct($storageCapacity)
  17. {
  18. $this->storageCapacity = $storageCapacity;
  19. }
  20. /**
  21. * Not implemented
  22. */
  23. public function parseFromXml($strXml)
  24. {
  25. throw new OssException("Not implemented.");
  26. }
  27. /**
  28. * 把StorageCapacityConfig序列化成xml
  29. *
  30. * @return string
  31. */
  32. public function serializeToXml()
  33. {
  34. $xml = new \SimpleXMLElement('<?xml version="1.0" encoding="utf-8"?><BucketUserQos></BucketUserQos>');
  35. $xml->addChild('StorageCapacity', strval($this->storageCapacity));
  36. return $xml->asXML();
  37. }
  38. /**
  39. * To string
  40. *
  41. * @return string
  42. */
  43. function __toString()
  44. {
  45. return $this->serializeToXml();
  46. }
  47. /**
  48. * Set storage capacity
  49. *
  50. * @param int $storageCapacity
  51. */
  52. public function setStorageCapacity($storageCapacity)
  53. {
  54. $this->storageCapacity = $storageCapacity;
  55. }
  56. /**
  57. * Get storage capacity
  58. *
  59. * @return int
  60. */
  61. public function getStorageCapacity()
  62. {
  63. return $this->storageCapacity;
  64. }
  65. private $storageCapacity = 0;
  66. }