RowDimension.php 1.8 KB

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