Dimension.php 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. <?php
  2. /**
  3. * 重庆赤晓店信息科技有限公司
  4. * https://www.chixiaodian.com
  5. * Copyright (c) 2023 赤店商城 All rights reserved.
  6. */
  7. abstract class PHPExcel_Worksheet_Dimension
  8. {
  9. /**
  10. * Visible?
  11. *
  12. * @var bool
  13. */
  14. private $visible = true;
  15. /**
  16. * Outline level
  17. *
  18. * @var int
  19. */
  20. private $outlineLevel = 0;
  21. /**
  22. * Collapsed
  23. *
  24. * @var bool
  25. */
  26. private $collapsed = false;
  27. /**
  28. * Index to cellXf. Null value means row has no explicit cellXf format.
  29. *
  30. * @var int|null
  31. */
  32. private $xfIndex;
  33. /**
  34. * Create a new PHPExcel_Worksheet_Dimension
  35. *
  36. * @param int $pIndex Numeric row index
  37. */
  38. public function __construct($initialValue = null)
  39. {
  40. // set dimension as unformatted by default
  41. $this->xfIndex = $initialValue;
  42. }
  43. /**
  44. * Get Visible
  45. *
  46. * @return bool
  47. */
  48. public function getVisible()
  49. {
  50. return $this->visible;
  51. }
  52. /**
  53. * Set Visible
  54. *
  55. * @param bool $pValue
  56. * @return PHPExcel_Worksheet_Dimension
  57. */
  58. public function setVisible($pValue = true)
  59. {
  60. $this->visible = $pValue;
  61. return $this;
  62. }
  63. /**
  64. * Get Outline Level
  65. *
  66. * @return int
  67. */
  68. public function getOutlineLevel()
  69. {
  70. return $this->outlineLevel;
  71. }
  72. /**
  73. * Set Outline Level
  74. *
  75. * Value must be between 0 and 7
  76. *
  77. * @param int $pValue
  78. * @throws PHPExcel_Exception
  79. * @return PHPExcel_Worksheet_Dimension
  80. */
  81. public function setOutlineLevel($pValue)
  82. {
  83. if ($pValue < 0 || $pValue > 7) {
  84. throw new PHPExcel_Exception("Outline level must range between 0 and 7.");
  85. }
  86. $this->outlineLevel = $pValue;
  87. return $this;
  88. }
  89. /**
  90. * Get Collapsed
  91. *
  92. * @return bool
  93. */
  94. public function getCollapsed()
  95. {
  96. return $this->collapsed;
  97. }
  98. /**
  99. * Set Collapsed
  100. *
  101. * @param bool $pValue
  102. * @return PHPExcel_Worksheet_Dimension
  103. */
  104. public function setCollapsed($pValue = true)
  105. {
  106. $this->collapsed = $pValue;
  107. return $this;
  108. }
  109. /**
  110. * Get index to cellXf
  111. *
  112. * @return int
  113. */
  114. public function getXfIndex()
  115. {
  116. return $this->xfIndex;
  117. }
  118. /**
  119. * Set index to cellXf
  120. *
  121. * @param int $pValue
  122. * @return PHPExcel_Worksheet_Dimension
  123. */
  124. public function setXfIndex($pValue = 0)
  125. {
  126. $this->xfIndex = $pValue;
  127. return $this;
  128. }
  129. /**
  130. * Implement PHP __clone to create a deep clone, not just a shallow copy.
  131. */
  132. public function __clone()
  133. {
  134. $vars = get_object_vars($this);
  135. foreach ($vars as $key => $value) {
  136. if (is_object($value)) {
  137. $this->$key = clone $value;
  138. } else {
  139. $this->$key = $value;
  140. }
  141. }
  142. }
  143. }