PHP 클래스 Box\Spout\Reader\XLSX\RowIterator

상속: implements Box\Spout\Reader\IteratorInterface
파일 보기 프로젝트 열기: box/spout

보호된 프로퍼티들

프로퍼티 타입 설명
$cellValueFormatter Helper to format cell values
$currentlyProcessedRowData Contains the data for the currently processed row (key = cell index, value = cell value)
$filePath Path of the XLSX file being read
$hasReachedEndOfFile Indicates whether all rows have been read
$lastColumnIndexProcessed Last column index processed (zero-based)
$lastRowIndexProcessed Last row index processed (one-based)
$nextRowIndexToBeProcessed Row index to be processed next (one-based)
$numColumns The number of columns the sheet has (0 meaning undefined)
$numReadRows TODO: This variable can be deleted when row indices get preserved
$rowDataBuffer Buffer used to store the row data, while checking if there are more rows to read
$sheetDataXMLFilePath string Path of the sheet data XML file as in [Content_Types].xml
$shouldPreserveEmptyRows Whether empty rows should be returned or skipped
$styleHelper Box\Spout\Reader\XLSX\Helper\StyleHelper Helper to work with styles
$xmlProcessor Helper Object to process XML nodes
$xmlReader The XMLReader object that will help read sheet's XML data

공개 메소드들

메소드 설명
__construct ( string $filePath, string $sheetDataXMLFilePath, ReaderOptions $options, SharedStringsHelper $sharedStringsHelper )
current ( ) : array | null Return the current element, either an empty row or from the buffer.
end ( ) : void Cleans up what was created to iterate over the object.
key ( ) : integer Return the key of the current element. Here, the row index.
next ( ) : void Move forward to next element. Reads data describing the next unprocessed row.
rewind ( ) : void Rewind the Iterator to the first element.
valid ( ) : boolean Checks if current position is valid

보호된 메소드들

메소드 설명
doesNeedDataForNextRowToBeProcessed ( ) : boolean Returns whether we need data for the next row to be processed.
getCellValue ( DOMNode $node ) : string | integer | float | boolean | DateTime | null Returns the (unescaped) correctly marshalled, cell value associated to the given XML node.
getColumnIndex ( Box\Spout\Reader\Wrapper\XMLReader $xmlReader ) : integer
getRowIndex ( Box\Spout\Reader\Wrapper\XMLReader $xmlReader ) : integer
isEmptyRow ( array $rowData ) : boolean
normalizeSheetDataXMLFilePath ( string $sheetDataXMLFilePath ) : string
processCellStartingNode ( Box\Spout\Reader\Wrapper\XMLReader $xmlReader ) : integer
processDimensionStartingNode ( Box\Spout\Reader\Wrapper\XMLReader $xmlReader ) : integer
processRowEndingNode ( ) : integer
processRowStartingNode ( Box\Spout\Reader\Wrapper\XMLReader $xmlReader ) : integer
processWorksheetEndingNode ( ) : integer
readDataForNextRow ( ) : void

메소드 상세

__construct() 공개 메소드

public __construct ( string $filePath, string $sheetDataXMLFilePath, ReaderOptions $options, SharedStringsHelper $sharedStringsHelper )
$filePath string Path of the XLSX file being read
$sheetDataXMLFilePath string Path of the sheet data XML file as in [Content_Types].xml
$options ReaderOptions Reader's current options
$sharedStringsHelper Box\Spout\Reader\XLSX\Helper\SharedStringsHelper Helper to work with shared strings

current() 공개 메소드

Return the current element, either an empty row or from the buffer.
public current ( ) : array | null
리턴 array | null

doesNeedDataForNextRowToBeProcessed() 보호된 메소드

We don't need to read data if: we have already read at least one row AND we need to preserve empty rows AND the last row that was read is not the row that need to be processed (i.e. if we need to return empty rows)
protected doesNeedDataForNextRowToBeProcessed ( ) : boolean
리턴 boolean Whether we need data for the next row to be processed.

end() 공개 메소드

Cleans up what was created to iterate over the object.
public end ( ) : void
리턴 void

getCellValue() 보호된 메소드

Returns the (unescaped) correctly marshalled, cell value associated to the given XML node.
protected getCellValue ( 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)

getColumnIndex() 보호된 메소드

protected getColumnIndex ( Box\Spout\Reader\Wrapper\XMLReader $xmlReader ) : integer
$xmlReader Box\Spout\Reader\Wrapper\XMLReader XMLReader object, positioned on a "" node
리턴 integer Column index

getRowIndex() 보호된 메소드

protected getRowIndex ( Box\Spout\Reader\Wrapper\XMLReader $xmlReader ) : integer
$xmlReader Box\Spout\Reader\Wrapper\XMLReader XMLReader object, positioned on a "" node
리턴 integer Row index

isEmptyRow() 보호된 메소드

protected isEmptyRow ( array $rowData ) : boolean
$rowData array
리턴 boolean Whether the given row is empty

key() 공개 메소드

Return the key of the current element. Here, the row index.
public key ( ) : integer
리턴 integer

next() 공개 메소드

Move forward to next element. Reads data describing the next unprocessed row.
public next ( ) : void
리턴 void

normalizeSheetDataXMLFilePath() 보호된 메소드

protected normalizeSheetDataXMLFilePath ( string $sheetDataXMLFilePath ) : string
$sheetDataXMLFilePath string Path of the sheet data XML file as in [Content_Types].xml
리턴 string Path of the XML file containing the sheet data, without the leading slash.

processCellStartingNode() 보호된 메소드

protected processCellStartingNode ( Box\Spout\Reader\Wrapper\XMLReader $xmlReader ) : integer
$xmlReader Box\Spout\Reader\Wrapper\XMLReader XMLReader object, positioned on a "" starting node
리턴 integer A return code that indicates what action should the processor take next

processDimensionStartingNode() 보호된 메소드

protected processDimensionStartingNode ( Box\Spout\Reader\Wrapper\XMLReader $xmlReader ) : integer
$xmlReader Box\Spout\Reader\Wrapper\XMLReader XMLReader object, positioned on a "" starting node
리턴 integer A return code that indicates what action should the processor take next

processRowEndingNode() 보호된 메소드

protected processRowEndingNode ( ) : integer
리턴 integer A return code that indicates what action should the processor take next

processRowStartingNode() 보호된 메소드

protected processRowStartingNode ( Box\Spout\Reader\Wrapper\XMLReader $xmlReader ) : integer
$xmlReader Box\Spout\Reader\Wrapper\XMLReader XMLReader object, positioned on a "" starting node
리턴 integer A return code that indicates what action should the processor take next

processWorksheetEndingNode() 보호된 메소드

protected processWorksheetEndingNode ( ) : integer
리턴 integer A return code that indicates what action should the processor take next

readDataForNextRow() 보호된 메소드

protected readDataForNextRow ( ) : void
리턴 void

rewind() 공개 메소드

Initializes the XMLReader object that reads the associated sheet data. The XMLReader is configured to be safe from billion laughs attack.
public rewind ( ) : void
리턴 void

valid() 공개 메소드

Checks if current position is valid
public valid ( ) : boolean
리턴 boolean

프로퍼티 상세

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

Helper to format cell values
protected $cellValueFormatter

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

Contains the data for the currently processed row (key = cell index, value = cell value)
protected $currentlyProcessedRowData

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

Path of the XLSX file being read
protected $filePath

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

Indicates whether all rows have been read
protected $hasReachedEndOfFile

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

Last column index processed (zero-based)
protected $lastColumnIndexProcessed

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

Last row index processed (one-based)
protected $lastRowIndexProcessed

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

Row index to be processed next (one-based)
protected $nextRowIndexToBeProcessed

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

The number of columns the sheet has (0 meaning undefined)
protected $numColumns

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

TODO: This variable can be deleted when row indices get preserved
protected $numReadRows

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

Buffer used to store the row data, while checking if there are more rows to read
protected $rowDataBuffer

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

Path of the sheet data XML file as in [Content_Types].xml
protected string $sheetDataXMLFilePath
리턴 string

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

Whether empty rows should be returned or skipped
protected $shouldPreserveEmptyRows

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

Helper to work with styles
protected StyleHelper,Box\Spout\Reader\XLSX\Helper $styleHelper
리턴 Box\Spout\Reader\XLSX\Helper\StyleHelper

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

Helper Object to process XML nodes
protected $xmlProcessor

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

The XMLReader object that will help read sheet's XML data
protected $xmlReader