Make ODS reader return Row object
This commit is contained in:
1 parent
68a96367a8
commit
102e17159c
16 files changed
+301
-67
No files matched your search
@@ -35,10 +35,15 @@ class Cell
|
||||
*/
|
||||
const TYPE_BOOLEAN = 4;
|
||||
|
||||
/**
|
||||
* Date cell type
|
||||
*/
|
||||
const TYPE_DATE = 5;
|
||||
|
||||
/**
|
||||
* Error cell type
|
||||
*/
|
||||
const TYPE_ERROR = 5;
|
||||
const TYPE_ERROR = 6;
|
||||
|
||||
/**
|
||||
* The value of this cell
|
||||
@@ -85,6 +90,14 @@ class Cell
|
||||
return $this->type;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $type
|
||||
*/
|
||||
public function setType($type)
|
||||
{
|
||||
$this->type = $type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the current value type
|
||||
*
|
||||
@@ -99,9 +112,12 @@ class Cell
|
||||
if (CellTypeHelper::isEmpty($value)) {
|
||||
return self::TYPE_EMPTY;
|
||||
}
|
||||
if (CellTypeHelper::isNumeric($this->getValue())) {
|
||||
if (CellTypeHelper::isNumeric($value)) {
|
||||
return self::TYPE_NUMERIC;
|
||||
}
|
||||
if (CellTypeHelper::isDateTimeOrDateInterval($value)) {
|
||||
return self::TYPE_DATE;
|
||||
}
|
||||
if (CellTypeHelper::isNonEmptyString($value)) {
|
||||
return self::TYPE_STRING;
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ class Row
|
||||
public function toArray()
|
||||
{
|
||||
return array_map(function (Cell $cell) {
|
||||
return $cell->getValue();
|
||||
return !$cell->isError() ? $cell->getValue() : null;
|
||||
}, $this->cells);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user