tagName != 'table:table-row')) { die('Row::__construct() needs a DOMElement parameter for a table-row element '); } $this->row = $row; } /** * Analyze a spreadsheet row and return the cells as an array of Calc_Cell * * @return array<\Osinet\OpenDocument\Calc\Cell> */ function getCells(): array { $cellNodeList = $this->row->childNodes; $cells = []; $iCell = 0; for ($icol = 0; $icol < $cellNodeList->length; $icol++) { $cellNode = $cellNodeList->item($icol); $count = NULL; if ($cellNode instanceof \DOMElement) { $count = $cellNode->getAttributeNS(Reader::NS_TABLE, 'number-columns-repeated'); } if (empty($count)) { $count = 1; } for ($j = 0; $j < $count; $j++) { $cells[$iCell++] = new Cell($cellNode); } } return $cells; } }