Row.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <?php
  2. /**
  3. * 重庆赤晓店信息科技有限公司
  4. * https://www.chixiaodian.com
  5. * Copyright (c) 2023 赤店商城 All rights reserved.
  6. */
  7. class PHPExcel_Worksheet_Row
  8. {
  9. /**
  10. * PHPExcel_Worksheet
  11. *
  12. * @var PHPExcel_Worksheet
  13. */
  14. private $parent;
  15. /**
  16. * Row index
  17. *
  18. * @var int
  19. */
  20. private $rowIndex = 0;
  21. /**
  22. * Create a new row
  23. *
  24. * @param PHPExcel_Worksheet $parent
  25. * @param int $rowIndex
  26. */
  27. public function __construct(PHPExcel_Worksheet $parent = null, $rowIndex = 1)
  28. {
  29. // Set parent and row index
  30. $this->parent = $parent;
  31. $this->rowIndex = $rowIndex;
  32. }
  33. /**
  34. * Destructor
  35. */
  36. public function __destruct()
  37. {
  38. unset($this->parent);
  39. }
  40. /**
  41. * Get row index
  42. *
  43. * @return int
  44. */
  45. public function getRowIndex()
  46. {
  47. return $this->rowIndex;
  48. }
  49. /**
  50. * Get cell iterator
  51. *
  52. * @param string $startColumn The column address at which to start iterating
  53. * @param string $endColumn Optionally, the column address at which to stop iterating
  54. * @return PHPExcel_Worksheet_CellIterator
  55. */
  56. public function getCellIterator($startColumn = 'A', $endColumn = null)
  57. {
  58. return new PHPExcel_Worksheet_RowCellIterator($this->parent, $this->rowIndex, $startColumn, $endColumn);
  59. }
  60. }