| 1 | <?php |
||
| 8 | class TableCell extends AbstractTableElement |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * @var TableRow |
||
| 12 | */ |
||
| 13 | protected $row; |
||
| 14 | |||
| 15 | /** |
||
| 16 | * @return TableRow |
||
| 17 | */ |
||
| 18 | 1 | public function getRow() |
|
| 19 | { |
||
| 20 | 1 | return $this->row; |
|
| 21 | } |
||
| 22 | |||
| 23 | /** |
||
| 24 | * @param TableRow|null $row |
||
| 25 | * |
||
| 26 | * @return $this |
||
| 27 | */ |
||
| 28 | 1 | public function setRow(TableRow $row = null) |
|
| 29 | { |
||
| 30 | 1 | $this->row = $row; |
|
| 31 | |||
| 32 | 1 | if (null !== $row && !in_array($this, $row->getCells())) { |
|
| 33 | $row->addCell($this); |
||
| 34 | } |
||
| 35 | |||
| 36 | 1 | return $this; |
|
| 37 | } |
||
| 38 | |||
| 39 | /** |
||
| 40 | * @return int |
||
| 41 | */ |
||
| 42 | 1 | public function getColspan() |
|
| 43 | { |
||
| 44 | 1 | return (int) $this->getAttribute('colspan') ?: 1; |
|
| 45 | } |
||
| 46 | |||
| 47 | /** |
||
| 48 | * @return int |
||
| 49 | */ |
||
| 50 | public function getRowspan() |
||
| 54 | } |
||
| 55 |