Partition.php 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. <?php
  2. /* * ********************************************************************
  3. * ProxmoxVPS product developed. (2017-07-10)
  4. * *
  5. *
  6. * CREATED BY MODULESGARDEN -> http://modulesgarden.com
  7. * CONTACT -> contact@modulesgarden.com
  8. *
  9. *
  10. * This software is furnished under a license and may be used and copied
  11. * only in accordance with the terms of such license and with the
  12. * inclusion of the above copyright notice. This software or any other
  13. * copies thereof may not be provided or otherwise made available to any
  14. * other person. No title to and ownership of the software is hereby
  15. * transferred.
  16. *
  17. *
  18. * ******************************************************************** */
  19. namespace MGProvision\Proxmox\v2\models;
  20. /**
  21. * Description of Partition
  22. *
  23. * @author Pawel Kopec <pawelk@modulesgarden.com>
  24. * @version 1.0.0
  25. */
  26. class Partition
  27. {
  28. private $device;
  29. private $boot;
  30. private $start;
  31. private $end;
  32. private $blocks;
  33. private $sectors;
  34. private $size;
  35. private $id;
  36. private $system;
  37. private $type;
  38. private $number;
  39. public function setAttributes($attributes)
  40. {
  41. foreach ($attributes as $name => $attValue)
  42. {
  43. $methodName = 'set' . ucfirst($name);
  44. if (method_exists($this, $methodName))
  45. $this->{$methodName}($attValue);
  46. }
  47. }
  48. public function getDevice()
  49. {
  50. return $this->device;
  51. }
  52. public function getBoot()
  53. {
  54. return $this->boot;
  55. }
  56. public function getStart()
  57. {
  58. return $this->start;
  59. }
  60. public function getEnd()
  61. {
  62. return $this->end;
  63. }
  64. public function getBlocks()
  65. {
  66. return $this->blocks;
  67. }
  68. public function getId()
  69. {
  70. return $this->id;
  71. }
  72. public function getSystem()
  73. {
  74. return $this->system;
  75. }
  76. public function getNumber()
  77. {
  78. return $this->number;
  79. }
  80. public function setDevice($device)
  81. {
  82. $this->device = $device;
  83. return $this;
  84. }
  85. public function setBoot($boot)
  86. {
  87. $this->boot = $boot;
  88. return $this;
  89. }
  90. public function setStart($start)
  91. {
  92. $this->start = $start;
  93. return $this;
  94. }
  95. public function setEnd($end)
  96. {
  97. $this->end = $end;
  98. return $this;
  99. }
  100. public function setBlocks($blocks)
  101. {
  102. $this->blocks = $blocks;
  103. return $this;
  104. }
  105. public function setId($id)
  106. {
  107. $this->id = $id;
  108. return $this;
  109. }
  110. public function setSystem($system)
  111. {
  112. $this->system = $system;
  113. return $this;
  114. }
  115. public function setNumber($number)
  116. {
  117. $this->number = $number;
  118. return $this;
  119. }
  120. public function isBoot()
  121. {
  122. return preg_match('/\*/', $this->getBoot());
  123. }
  124. public function getType()
  125. {
  126. return $this->type;
  127. }
  128. public function setType($type)
  129. {
  130. $this->type = $type;
  131. return $this;
  132. }
  133. public function getSectors()
  134. {
  135. return $this->sectors;
  136. }
  137. public function getSize()
  138. {
  139. return $this->size;
  140. }
  141. public function setSectors($sectors)
  142. {
  143. $this->sectors = $sectors;
  144. return $this;
  145. }
  146. public function setSize($size)
  147. {
  148. $this->size = $size;
  149. return $this;
  150. }
  151. }