Row.php 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. <?php
  2. /**
  3. * PHPExcel
  4. *
  5. * Copyright (c) 2006 - 2013 PHPExcel
  6. *
  7. * This library is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU Lesser General Public
  9. * License as published by the Free Software Foundation; either
  10. * version 2.1 of the License, or (at your option) any later version.
  11. *
  12. * This library is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * Lesser General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU Lesser General Public
  18. * License along with this library; if not, write to the Free Software
  19. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  20. *
  21. * @category PHPExcel
  22. * @package PHPExcel_Worksheet
  23. * @copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel)
  24. * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
  25. * @version 1.7.9, 2013-06-02
  26. */
  27. /**
  28. * PHPExcel_Worksheet_Row
  29. *
  30. * Represents a row in PHPExcel_Worksheet, used by PHPExcel_Worksheet_RowIterator
  31. *
  32. * @category PHPExcel
  33. * @package PHPExcel_Worksheet
  34. * @copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel)
  35. */
  36. class PHPExcel_Worksheet_Row
  37. {
  38. /**
  39. * PHPExcel_Worksheet
  40. *
  41. * @var PHPExcel_Worksheet
  42. */
  43. private $_parent;
  44. /**
  45. * Row index
  46. *
  47. * @var int
  48. */
  49. private $_rowIndex = 0;
  50. /**
  51. * Create a new row
  52. *
  53. * @param PHPExcel_Worksheet $parent
  54. * @param int $rowIndex
  55. */
  56. public function __construct(PHPExcel_Worksheet $parent = null, $rowIndex = 1) {
  57. // Set parent and row index
  58. $this->_parent = $parent;
  59. $this->_rowIndex = $rowIndex;
  60. }
  61. /**
  62. * Destructor
  63. */
  64. public function __destruct() {
  65. unset($this->_parent);
  66. }
  67. /**
  68. * Get row index
  69. *
  70. * @return int
  71. */
  72. public function getRowIndex() {
  73. return $this->_rowIndex;
  74. }
  75. /**
  76. * Get cell iterator
  77. *
  78. * @return PHPExcel_Worksheet_CellIterator
  79. */
  80. public function getCellIterator() {
  81. return new PHPExcel_Worksheet_CellIterator($this->_parent, $this->_rowIndex);
  82. }
  83. }