PHP 클래스 Box\Spout\Reader\XLSX\Helper\CellValueFormatter

파일 보기 프로젝트 열기: box/spout

보호된 프로퍼티들

프로퍼티 타입 설명
$escaper Used to unescape XML data
$sharedStringsHelper Helper to work with shared strings
$shouldFormatDates Whether date/time values should be returned as PHP objects or be formatted as strings
$styleHelper Helper to work with styles

공개 메소드들

메소드 설명
__construct ( SharedStringsHelper $sharedStringsHelper, StyleHelper $styleHelper, boolean $shouldFormatDates )
extractAndFormatNodeValue ( DOMNode $node ) : string | integer | float | boolean | DateTime | null Returns the (unescaped) correctly marshalled, cell value associated to the given XML node.

보호된 메소드들

메소드 설명
formatBooleanCellValue ( string $nodeValue ) : boolean Returns the cell Boolean value from a specific node's Value.
formatDateCellValue ( string $nodeValue ) : DateTime | string | null Returns a cell's PHP Date value, associated to the given stored nodeValue.
formatExcelTimestampValue ( float $nodeValue, integer $cellStyleId ) : DateTime | null Returns a cell's PHP Date value, associated to the given timestamp.
formatExcelTimestampValueAsDateValue ( float $nodeValue, integer $cellStyleId ) : DateTime | string | null Returns a cell's PHP Date value, associated to the given timestamp.
formatExcelTimestampValueAsTimeValue ( float $nodeValue, integer $cellStyleId ) : DateTime | string Returns a cell's PHP DateTime value, associated to the given timestamp.
formatInlineStringCellValue ( DOMNode $node ) : string Returns the cell String value where string is inline.
formatNumericCellValue ( string $nodeValue, integer $cellStyleId ) : integer | float | DateTime | null Returns the cell Numeric value from string of nodeValue.
formatSharedStringCellValue ( string $nodeValue ) : string Returns the cell String value from shared-strings file using nodeValue index.
formatStrCellValue ( string $nodeValue ) : string Returns the cell String value, where string is stored in value node.
getVNodeValue ( DOMNode $node ) : string Returns the cell's string value from a node's nested value node

메소드 상세

__construct() 공개 메소드

public __construct ( SharedStringsHelper $sharedStringsHelper, StyleHelper $styleHelper, boolean $shouldFormatDates )
$sharedStringsHelper SharedStringsHelper Helper to work with shared strings
$styleHelper StyleHelper Helper to work with styles
$shouldFormatDates boolean Whether date/time values should be returned as PHP objects or be formatted as strings

extractAndFormatNodeValue() 공개 메소드

Returns the (unescaped) correctly marshalled, cell value associated to the given XML node.
public extractAndFormatNodeValue ( DOMNode $node ) : string | integer | float | boolean | DateTime | null
$node DOMNode
리턴 string | integer | float | boolean | DateTime | null The value associated with the cell (null when the cell has an error)

formatBooleanCellValue() 보호된 메소드

Returns the cell Boolean value from a specific node's Value.
protected formatBooleanCellValue ( string $nodeValue ) : boolean
$nodeValue string
리턴 boolean The value associated with the cell

formatDateCellValue() 보호된 메소드

Returns a cell's PHP Date value, associated to the given stored nodeValue.
protected formatDateCellValue ( string $nodeValue ) : DateTime | string | null
$nodeValue string ISO 8601 Date string
리턴 DateTime | string | null The value associated with the cell or NULL if invalid date value

formatExcelTimestampValue() 보호된 메소드

NOTE: The timestamp is a float representing the number of days since January 1st, 1900. NOTE: The timestamp can also represent a time, if it is a value between 0 and 1.
protected formatExcelTimestampValue ( float $nodeValue, integer $cellStyleId ) : DateTime | null
$nodeValue float
$cellStyleId integer 0 being the default style
리턴 DateTime | null The value associated with the cell or NULL if invalid date value

formatExcelTimestampValueAsDateValue() 보호된 메소드

NOTE: The timestamp is a float representing the number of days since January 1st, 1900.
protected formatExcelTimestampValueAsDateValue ( float $nodeValue, integer $cellStyleId ) : DateTime | string | null
$nodeValue float
$cellStyleId integer 0 being the default style
리턴 DateTime | string | null The value associated with the cell or NULL if invalid date value

formatExcelTimestampValueAsTimeValue() 보호된 메소드

Only the time value matters. The date part is set to Jan 1st, 1900 (base Excel date).
protected formatExcelTimestampValueAsTimeValue ( float $nodeValue, integer $cellStyleId ) : DateTime | string
$nodeValue float
$cellStyleId integer 0 being the default style
리턴 DateTime | string The value associated with the cell

formatInlineStringCellValue() 보호된 메소드

Returns the cell String value where string is inline.
protected formatInlineStringCellValue ( DOMNode $node ) : string
$node DOMNode
리턴 string The value associated with the cell (null when the cell has an error)

formatNumericCellValue() 보호된 메소드

The value can also represent a timestamp and a DateTime will be returned.
protected formatNumericCellValue ( string $nodeValue, integer $cellStyleId ) : integer | float | DateTime | null
$nodeValue string
$cellStyleId integer 0 being the default style
리턴 integer | float | DateTime | null The value associated with the cell

formatSharedStringCellValue() 보호된 메소드

Returns the cell String value from shared-strings file using nodeValue index.
protected formatSharedStringCellValue ( string $nodeValue ) : string
$nodeValue string
리턴 string The value associated with the cell (null when the cell has an error)

formatStrCellValue() 보호된 메소드

Returns the cell String value, where string is stored in value node.
protected formatStrCellValue ( string $nodeValue ) : string
$nodeValue string
리턴 string The value associated with the cell (null when the cell has an error)

getVNodeValue() 보호된 메소드

Returns the cell's string value from a node's nested value node
protected getVNodeValue ( DOMNode $node ) : string
$node DOMNode
리턴 string The value associated with the cell

프로퍼티 상세

$escaper 보호되어 있는 프로퍼티

Used to unescape XML data
protected $escaper

$sharedStringsHelper 보호되어 있는 프로퍼티

Helper to work with shared strings
protected $sharedStringsHelper

$shouldFormatDates 보호되어 있는 프로퍼티

Whether date/time values should be returned as PHP objects or be formatted as strings
protected $shouldFormatDates

$styleHelper 보호되어 있는 프로퍼티

Helper to work with styles
protected $styleHelper