RowDimension.Class.php 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: phperstar
  5. * Date: 2020/8/11
  6. * Time: 6:22 PM
  7. */
  8. namespace Util\PHPExcel\Worksheet;
  9. use Util\PHPExcel\Worksheet\Dimension;
  10. class RowDimension extends Dimension
  11. {
  12. /**
  13. * Row index
  14. *
  15. * @var int
  16. */
  17. private $rowIndex;
  18. /**
  19. * Row height (in pt)
  20. *
  21. * When this is set to a negative value, the row height should be ignored by IWriter
  22. *
  23. * @var double
  24. */
  25. private $height = -1;
  26. /**
  27. * ZeroHeight for Row?
  28. *
  29. * @var bool
  30. */
  31. private $zeroHeight = false;
  32. /**
  33. * Create a new PHPExcel_Worksheet_RowDimension
  34. *
  35. * @param int $pIndex Numeric row index
  36. */
  37. public function __construct($pIndex = 0)
  38. {
  39. // Initialise values
  40. $this->rowIndex = $pIndex;
  41. // set dimension as unformatted by default
  42. parent::__construct(null);
  43. }
  44. /**
  45. * Get Row Index
  46. *
  47. * @return int
  48. */
  49. public function getRowIndex()
  50. {
  51. return $this->rowIndex;
  52. }
  53. /**
  54. * Set Row Index
  55. *
  56. * @param int $pValue
  57. * @return PHPExcel_Worksheet_RowDimension
  58. */
  59. public function setRowIndex($pValue)
  60. {
  61. $this->rowIndex = $pValue;
  62. return $this;
  63. }
  64. /**
  65. * Get Row Height
  66. *
  67. * @return double
  68. */
  69. public function getRowHeight()
  70. {
  71. return $this->height;
  72. }
  73. /**
  74. * Set Row Height
  75. *
  76. * @param double $pValue
  77. * @return PHPExcel_Worksheet_RowDimension
  78. */
  79. public function setRowHeight($pValue = -1)
  80. {
  81. $this->height = $pValue;
  82. return $this;
  83. }
  84. /**
  85. * Get ZeroHeight
  86. *
  87. * @return bool
  88. */
  89. public function getZeroHeight()
  90. {
  91. return $this->zeroHeight;
  92. }
  93. /**
  94. * Set ZeroHeight
  95. *
  96. * @param bool $pValue
  97. * @return PHPExcel_Worksheet_RowDimension
  98. */
  99. public function setZeroHeight($pValue = false)
  100. {
  101. $this->zeroHeight = $pValue;
  102. return $this;
  103. }
  104. }