function _load(TikiSheet &$sheet) { $sheetlib = TikiLib::lib('sheet'); $tikilib = TikiLib::lib('tiki'); $result = $tikilib->query("\n\t\t\tSELECT `rowIndex`, `columnIndex`, `value`, `calculation`, `width`, `height`, `format`, `style`, `class`, `user`\n\t\t\tFROM `tiki_sheet_values`\n\t\t\tWHERE\n\t\t\t\t`sheetId` = ? AND\n\t\t\t\t? >= `begin` AND\n\t\t\t\t(\n\t\t\t\t\t`end` IS NULL OR\n\t\t\t\t\t`end` > ?\n\t\t\t\t)\n\t\t", array($this->id, (int) $this->readDate, (int) $this->readDate)); while ($row = $result->fetchRow()) { $sheet->initCell($row['rowIndex'], $row['columnIndex']); $sheet->setValue($row['value']); $sheet->setCalculation($row['calculation']); $sheet->setColSpan($row['width']); $sheet->setRowSpan($row['height']); $sheet->setDeadCells(); $sheet->setFormat($row['format']); $sheet->setStyle($row['style']); $sheet->setClass($row['class']); } // Fetching the layout informations. $result2 = $tikilib->query("\n\t\t\tSELECT `className`, `headerRow`, `footerRow`, `parseValues`, `metadata`\n\t\t\tFROM `tiki_sheet_layout`\n\t\t\tWHERE\n\t\t\t\t`sheetId` = ? AND\n\t\t\t\t? >= `begin` AND\n\t\t\t\t( `end` IS NULL OR `end` > ? )\n\t\t", array($this->id, (int) $this->readDate, (int) $this->readDate)); if ($row = $result2->fetchRow()) { $sheet->configureLayout($row['className'], $row['headerRow'], $row['footerRow'], $row['parseValues'], $row['metadata']); } return true; }