| 1 | <?php |
||
| 7 | class Row |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * The cells in this row |
||
| 11 | * @var Cell[] |
||
| 12 | */ |
||
| 13 | protected $cells = []; |
||
| 14 | |||
| 15 | /** |
||
| 16 | * The row style |
||
| 17 | * @var Style |
||
| 18 | */ |
||
| 19 | protected $style; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * Row constructor. |
||
| 23 | * @param Cell[] $cells |
||
| 24 | * @param Style|null $style |
||
| 25 | */ |
||
| 26 | 172 | public function __construct(array $cells, $style) |
|
| 32 | |||
| 33 | /** |
||
| 34 | * @return Cell[] $cells |
||
| 35 | */ |
||
| 36 | 129 | public function getCells() |
|
| 40 | |||
| 41 | /** |
||
| 42 | * @param Cell[] $cells |
||
| 43 | * @return Row |
||
| 44 | */ |
||
| 45 | 172 | public function setCells(array $cells) |
|
| 54 | |||
| 55 | /** |
||
| 56 | * @param Cell $cell |
||
| 57 | * @param int $cellIndex |
||
| 58 | * @return Row |
||
| 59 | */ |
||
| 60 | 36 | public function setCellAtIndex(Cell $cell, $cellIndex) |
|
| 66 | |||
| 67 | /** |
||
| 68 | * @param int $cellIndex |
||
| 69 | * @return Cell|null |
||
| 70 | */ |
||
| 71 | 1 | public function getCellAtIndex($cellIndex) |
|
| 72 | { |
||
| 73 | 1 | return isset($this->cells[$cellIndex]) ? $this->cells[$cellIndex] : null; |
|
| 74 | } |
||
| 75 | |||
| 76 | /** |
||
| 77 | * @param Cell $cell |
||
| 78 | * @return Row |
||
| 79 | */ |
||
| 80 | 146 | public function addCell(Cell $cell) |
|
| 86 | |||
| 87 | /** |
||
| 88 | * @return int |
||
| 89 | */ |
||
| 90 | 105 | public function getNumCells() |
|
| 94 | |||
| 95 | /** |
||
| 96 | * @return Style |
||
| 97 | */ |
||
| 98 | 53 | public function getStyle() |
|
| 102 | |||
| 103 | /** |
||
| 104 | * @param Style|null $style |
||
| 105 | * @return Row |
||
| 106 | */ |
||
| 107 | 172 | public function setStyle($style) |
|
| 113 | |||
| 114 | /** |
||
| 115 | * @return array The row values, as array |
||
| 116 | */ |
||
| 117 | public function toArray() |
||
| 123 | } |
||
| 124 |