private function FeedsExcelParser::getFixed in Feeds Excel 6
Same name and namespace in other branches
- 7 ExcelParser.inc \FeedsExcelParser::getFixed()
Sort out the given fixed cells.
1 call to FeedsExcelParser::getFixed()
- FeedsExcelParser::getSheets in ./
ExcelParser.inc - Retrieve all relevant sheets from dataset.
File
- ./
ExcelParser.inc, line 102
Class
- FeedsExcelParser
- Parses a given file as a Excel file.
Code
private function getFixed($sheet) {
// Store fixed cells in sheet
$fixed = array();
if ($this->config['fixed']) {
$max = array(
'rows' => $sheet['numRows'],
'cols' => $sheet['numCols'],
);
$fixed_range = new ExcelRange($this->config['fixed'], $max);
foreach ($sheet['cells'] as $row => $cols) {
if ($fixed_range
->isRowInAnyRange($row)) {
foreach ($cols as $col => $val) {
if ($fixed_range
->isCellInAnyRange($row, $col)) {
$cell = array(
'value' => $val,
'type' => $sheet['cellsInfo'][$row][$col]['type'],
'raw' => isset($sheet['cellsInfo'][$row][$col]['raw']) ? $sheet['cellsInfo'][$row][$col]['raw'] : $val,
'column' => $col,
'row' => $row,
);
$fixed["{$row}-{$col}"] = $cell;
}
}
}
}
}
return $fixed;
}