PHP 클래스 Box\Spout\Reader\ODS\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)
$hasAlreadyBeenRewound Whether the iterator has already been rewound once
$hasAlreadyReadOneCellInCurrentRow Whether at least one cell has been read for the row currently being processed
$hasReachedEndOfFile Indicates whether all rows have been read
$lastProcessedCellValue Value of the last processed cell (because when reading cell at column N+1, cell N is processed)
$lastRowIndexProcessed Last row index processed (one-based)
$nextRowIndexToBeProcessed Row index to be processed next (one-based)
$numColumnsRepeated Number of times the last cell value should be copied to the cells on its right
$numRowsRepeated Number of times the last processed row should be repeated
$rowDataBuffer Buffer used to store the row data, while checking if there are more rows to read
$shouldPreserveEmptyRows Whether empty rows should be returned or skipped
$xmlProcessor Helper Object to process XML nodes
$xmlReader The XMLReader object that will help read sheet's XML data

공개 메소드들

메소드 설명
__construct ( Box\Spout\Reader\Wrapper\XMLReader $xmlReader, Box\Spout\Reader\ODS\ReaderOptions $options )
current ( ) : array | null Return the current element, from the buffer.
end ( ) : void Cleans up what was created to iterate over the object.
key ( ) : integer Return the key of the current element
next ( ) : void Move forward to next element. Empty rows will be skipped.
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 | DateInterval | null Returns the (unescaped) correctly marshalled, cell value associated to the given XML node.
getNumColumnsRepeatedForCurrentNode ( Box\Spout\Reader\Wrapper\XMLReader $xmlReader ) : integer
getNumRowsRepeatedForCurrentNode ( Box\Spout\Reader\Wrapper\XMLReader $xmlReader ) : integer
isEmptyRow ( array $rowData, $lastReadCellValue ) : boolean After finishing processing each cell, a row is considered empty if it contains no cells or if the value of the last read cell is an empty string.
processCellStartingNode ( Box\Spout\Reader\Wrapper\XMLReader $xmlReader ) : integer
processRowEndingNode ( ) : integer
processRowStartingNode ( Box\Spout\Reader\Wrapper\XMLReader $xmlReader ) : integer
processTableEndingNode ( ) : integer
readDataForNextRow ( ) : void

메소드 상세

__construct() 공개 메소드

public __construct ( Box\Spout\Reader\Wrapper\XMLReader $xmlReader, Box\Spout\Reader\ODS\ReaderOptions $options )
$xmlReader Box\Spout\Reader\Wrapper\XMLReader XML Reader, positioned on the "" element
$options Box\Spout\Reader\ODS\ReaderOptions Reader's current options

current() 공개 메소드

Return the current element, from the buffer.
public current ( ) : array | null
리턴 array | null

doesNeedDataForNextRowToBeProcessed() 보호된 메소드

We DO need to read data if: - we have not read any rows yet OR - the next row to be processed immediately follows the last read row
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 | DateInterval | null
$node DOMNode
리턴 string | integer | float | boolean | DateTime | DateInterval | null The value associated with the cell, empty string if cell's type is void/undefined, null on error

getNumColumnsRepeatedForCurrentNode() 보호된 메소드

protected getNumColumnsRepeatedForCurrentNode ( Box\Spout\Reader\Wrapper\XMLReader $xmlReader ) : integer
$xmlReader Box\Spout\Reader\Wrapper\XMLReader XMLReader object, positioned on a "" starting node
리턴 integer The value of "table:number-columns-repeated" attribute of the current node, or 1 if attribute missing

getNumRowsRepeatedForCurrentNode() 보호된 메소드

protected getNumRowsRepeatedForCurrentNode ( Box\Spout\Reader\Wrapper\XMLReader $xmlReader ) : integer
$xmlReader Box\Spout\Reader\Wrapper\XMLReader XMLReader object, positioned on a "" starting node
리턴 integer The value of "table:number-rows-repeated" attribute of the current node, or 1 if attribute missing

isEmptyRow() 보호된 메소드

After finishing processing each cell, the last read cell is not part of the row data yet (as we still need to apply the "num-columns-repeated" attribute).
protected isEmptyRow ( array $rowData, $lastReadCellValue ) : boolean
$rowData array
리턴 boolean Whether the row is empty

key() 공개 메소드

Return the key of the current element
public key ( ) : integer
리턴 integer

next() 공개 메소드

Move forward to next element. Empty rows will be skipped.
public next ( ) : void
리턴 void

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

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

processTableEndingNode() 보호된 메소드

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

readDataForNextRow() 보호된 메소드

protected readDataForNextRow ( ) : void
리턴 void

rewind() 공개 메소드

NOTE: It can only be done once, as it is not possible to read an XML file backwards.
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

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

Whether the iterator has already been rewound once
protected $hasAlreadyBeenRewound

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

Whether at least one cell has been read for the row currently being processed
protected $hasAlreadyReadOneCellInCurrentRow

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

Indicates whether all rows have been read
protected $hasReachedEndOfFile

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

Value of the last processed cell (because when reading cell at column N+1, cell N is processed)
protected $lastProcessedCellValue

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

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

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

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

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

Number of times the last cell value should be copied to the cells on its right
protected $numColumnsRepeated

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

Number of times the last processed row should be repeated
protected $numRowsRepeated

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

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

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

Whether empty rows should be returned or skipped
protected $shouldPreserveEmptyRows

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

Helper Object to process XML nodes
protected $xmlProcessor

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

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