Property | Type | Description | |
---|---|---|---|
$builtinNumFmtIdIndicatingDates | Array containing the IDs of built-in number formats indicating a date | ||
$builtinNumFmtIdToNumFormatMapping | Mapping between built-in numFmtId and the associated format - for dates only | ||
$customNumberFormats | Array containing a mapping NUM_FMT_ID => FORMAT_CODE | ||
$filePath | Path of the XLSX file being read | ||
$numFmtIdToIsDateFormatCache | Cache containing a mapping NUM_FMT_ID => IS_DATE_FORMAT. Used to avoid lots of recalculations | ||
$stylesAttributes | Array containing a mapping STYLE_ID => [STYLE_ATTRIBUTES] |
Method | Description | |
---|---|---|
__construct ( string $filePath ) | ||
getNumberFormatCode ( integer $styleId ) : string | Returns the format as defined in "styles.xml" of the given style. | |
shouldFormatNumericValueAsDate ( integer $styleId ) : boolean | Returns whether the style with the given ID should consider numeric values as timestamps and format the cell as a date. |
Method | Description | |
---|---|---|
doesNumFmtIdIndicateDate ( integer $numFmtId ) : boolean | Returns whether the number format ID indicates that the number is a date. | |
doesStyleIndicateDate ( array $styleAttributes ) : boolean | ||
extractNumberFormats ( Box\Spout\Reader\Wrapper\XMLReader $xmlReader ) : void | Extracts number formats from the "numFmt" nodes. | |
extractRelevantInfo ( ) : void | Reads the styles.xml file and extract the relevant information from the file. | |
extractStyleAttributes ( Box\Spout\Reader\Wrapper\XMLReader $xmlReader ) : void | Extracts style attributes from the "xf" nodes, inside the "cellXfs" section. | |
getCustomNumberFormats ( ) : array | ||
getFormatCodeForNumFmtId ( integer $numFmtId ) : string | null | ||
getStylesAttributes ( ) : array | ||
isFormatCodeCustomDateFormat ( string | null $formatCode ) : boolean | ||
isFormatCodeMatchingDateFormatPattern ( string $formatCode ) : boolean | ||
isNumFmtIdBuiltInDateFormat ( integer $numFmtId ) : boolean |
public __construct ( string $filePath ) | ||
$filePath | string | Path of the XLSX file being read |
protected doesNumFmtIdIndicateDate ( integer $numFmtId ) : boolean | ||
$numFmtId | integer | |
return | boolean | Whether the number format ID indicates that the number is a date |
protected doesStyleIndicateDate ( array $styleAttributes ) : boolean | ||
$styleAttributes | array | Array containing the style attributes (2 keys: "applyNumberFormat" and "numFmtId") |
return | boolean | Whether the style with the given attributes indicates that the number is a date |
protected extractNumberFormats ( Box\Spout\Reader\Wrapper\XMLReader $xmlReader ) : void | ||
$xmlReader | Box\Spout\Reader\Wrapper\XMLReader | XML Reader positioned on the "numFmts" node |
return | void |
protected extractRelevantInfo ( ) : void | ||
return | void |
protected extractStyleAttributes ( Box\Spout\Reader\Wrapper\XMLReader $xmlReader ) : void | ||
$xmlReader | Box\Spout\Reader\Wrapper\XMLReader | XML Reader positioned on the "cellXfs" node |
return | void |
protected getCustomNumberFormats ( ) : array | ||
return | array | The custom number formats |
public getNumberFormatCode ( integer $styleId ) : string | ||
$styleId | integer | Zero-based style ID |
return | string | The number format code associated with the given style |
protected getStylesAttributes ( ) : array | ||
return | array | The styles attributes |
protected isFormatCodeMatchingDateFormatPattern ( string $formatCode ) : boolean | ||
$formatCode | string | |
return | boolean | Whether the given format code matches a date format pattern |
protected isNumFmtIdBuiltInDateFormat ( integer $numFmtId ) : boolean | ||
$numFmtId | integer | |
return | boolean | Whether the number format ID indicates that the number is a date |
public shouldFormatNumericValueAsDate ( integer $styleId ) : boolean | ||
$styleId | integer | Zero-based style ID |
return | boolean | Whether the cell with the given cell should display a date instead of a numeric value |
protected $builtinNumFmtIdIndicatingDates |
protected static $builtinNumFmtIdToNumFormatMapping |
protected $customNumberFormats |
protected $numFmtIdToIsDateFormatCache |