Column.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_Column
  8. {
  9. /**
  10. * PHPExcel_Worksheet
  11. *
  12. * @var PHPExcel_Worksheet
  13. */
  14. private $parent;
  15. /**
  16. * Column index
  17. *
  18. * @var string
  19. */
  20. private $columnIndex;
  21. /**
  22. * Create a new column
  23. *
  24. * @param PHPExcel_Worksheet $parent
  25. * @param string $columnIndex
  26. */
  27. public function __construct(PHPExcel_Worksheet $parent = null, $columnIndex = 'A')
  28. {
  29. // Set parent and column index
  30. $this->parent = $parent;
  31. $this->columnIndex = $columnIndex;
  32. }
  33. /**
  34. * Destructor
  35. */
  36. public function __destruct()
  37. {
  38. unset($this->parent);
  39. }
  40. /**
  41. * Get column index
  42. *
  43. * @return string
  44. */
  45. public function getColumnIndex()
  46. {
  47. return $this->columnIndex;
  48. }
  49. /**
  50. * Get cell iterator
  51. *
  52. * @param integer $startRow The row number at which to start iterating
  53. * @param integer $endRow Optionally, the row number at which to stop iterating
  54. * @return PHPExcel_Worksheet_CellIterator
  55. */
  56. public function getCellIterator($startRow = 1, $endRow = null)
  57. {
  58. return new PHPExcel_Worksheet_ColumnCellIterator($this->parent, $this->columnIndex, $startRow, $endRow);
  59. }
  60. }