context; } public function addRow(GridRow $row): void { $this->rows[] = $row; } /** * @return GridRow[] */ public function getRows(): iterable { return $this->rows; } public function getColumns(): iterable { $columns = []; foreach ($this->rows as $gridRow) { $columns += $gridRow->getColumns(); } return $columns; } public function getSpan(): int { if (!isset($this->rows[0]) || ($this->context->getDrawingConfiguration()->isLanguageComparisonMode() && count($this->context->getDrawingConfiguration()->getSelectedLanguageIds()) > 1) ) { return 1; } $span = 0; foreach ($this->rows[0]->getColumns() as $column) { $span += $column->getColSpan(); } return $span ?: 1; } }